Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ntijoh-daniel-berg committed Oct 16, 2023
0 parents commit fb6e295
Show file tree
Hide file tree
Showing 20 changed files with 764 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish to GitHub Pages

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Includes the AsciiDoctor GitHub Pages Action to convert adoc files to html and publish to gh-pages branch
- name: asciidoctor-ghpages
uses: ntijoh-te4/asciidoctor-ghpages-action@1af5baccd44ff01c9cb42030b0ee6d5aab4d5d8b
with:
#pdf_build: true
asciidoctor_params: -r asciidoctor-kroki
# adoc_file_ext: .ascii # default is .adoc
source_dir: docs/ # default is .
# slides_build: true
#pre_build: bundle install
# post_build:
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.ruby-version
**/.DS_STORE
docs/index.html
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source 'https://rubygems.org'

gem 'asciidoctor'
gem 'coderay'
gem 'asciidoctor-kroki'
gem 'asciidoctor-tabs'
21 changes: 21 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
GEM
remote: https://rubygems.org/
specs:
asciidoctor (2.0.20)
asciidoctor-kroki (0.8.0)
asciidoctor (~> 2.0)
asciidoctor-tabs (1.0.0.beta.6)
asciidoctor (>= 2.0.0, < 3.0.0)
coderay (1.1.3)

PLATFORMS
arm64-darwin-22

DEPENDENCIES
asciidoctor
asciidoctor-kroki
asciidoctor-tabs
coderay

BUNDLED WITH
2.4.19
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 ntijoh-te4

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Verktygsboken

## 1. Installation

### 1.1 Ruby

#### 1.1.1 Windows

Om du har [Chocolatey](https://chocolatey.org/): `choco install ruby`

Annars : [RubyInstaller for Windows](https://rubyinstaller.org/)

#### 1.1.2 MacOs

1. Installera [Homebrew](https://brew.sh/)
2. `brew install ruby`

### 1.2 Asciidoctor

I verktygsbokens rotmapp: `bundle install`

## 2. Bygga boken lokalt

I verktygsbokens rotmapp: `asciidoctor -r asciidoctor-kroki -r asciidoctor-tabs docs/index.adoc`

Den färdigbyggda boken finns i `docs/index.html`

Öppna gärna `docs/index.html` med VS Code Live Server

### 2.1 Bygga boken lokalt automagiskt vid filändring

#### 2.1.1 Windows

Vet ej

#### 2.1.1 MacOs

`brew install fswatch`
`fswatch -o ./docs -e "index.html" | xargs -n1 -I{} asciidoctor -r asciidoctor-kroki -r asciidoctor-tabs docs/index.adoc`


## 3. Bygga boken till GH Pages.

Boken byggs automagiskt vid push till main-branchen på GitHub (kan ta några minuter).
8 changes: 8 additions & 0 deletions docs/chapters/chapter_template_folder/chapter.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
:imagesdir: chapters/chapter_template_folder/images


= Chapter Title Goes Here

Wut?

image::logo.png[Sinatra Logo]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions docs/chapters/combining_tools/chapter.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:imagesdir: chapters/test/images

= Kombinering av verktyg

== Sammanfogning

== Nästning

== Ihopvävning
Binary file added docs/chapters/combining_tools/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions docs/chapters/flow_and_state/chapter.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
:imagesdir: chapters/flow_and_state/images


= Flöde och State

Att programmera är att ge instruktioner till en dator, eller snarare datorns processor.

En processor kan bara göra en sak åt gången, och instruktionerna utförs därför en efter en, i ett _flöde_.

Under _flödets_ gång kommer variabler att skapas och dess värden uppdateras.

_State_ är värdet på alla variabler i ett program, _vid ett givet tillfälle_.

Programmets _state_ ändras alltså allteftersom programmet körs.

Att programmera handlar därför om att skapa ett _flöde_ som bearbetar _state_ och ser till att programmet har rätt _state_ när det är klart.

Man kan alltså se _flödet_ som en _serie av transformationer_ av _state_.

För att konstruera programmets _flöde_ och för att transformera _state_ finns ett _begränsat_ antal verktyg som används av alla programmerare oavsett vilka program de skriver eller språk de använder.

Genom att kombinera dessa verktyg på olika sätt, kan man skapa _alla_ program.

Verktygen är oberoende av kod, men kan så klart implementeras i kod i valfritt programmeringsspråk.

Den här boken går igenom de verktyg man behöver för att klara Programmering 1 (och antagligen bra mycket mer än så).

== Flödesschema

För att illutstrera verktygen används flödesscheman.

Flödesscheman fungerar såhär ...
Binary file added docs/chapters/flow_and_state/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions docs/chapters/goals_and_tools/chapter.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:imagesdir: chapters/test/images


= Mål och Verktyg

icon:exclamation-circle[] Här behövs text om programmerare sätter upp mål- och delmål och hur de använder verktyg för att uppnå dessa mål- och delmål. Gärna med praktiska exempel.
Binary file added docs/chapters/goals_and_tools/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions docs/chapters/tool_centered_assignments/chapter.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
:imagesdir: chapters/test/images


= Verktygsbaserade Uppgifter

Wut

image::logo.png[Sinatra Logo]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit fb6e295

Please sign in to comment.