Skip to content

Commit

Permalink
Merge pull request #26 from MatthiasPopp/master
Browse files Browse the repository at this point in the history
Hotfix Windows + Linux Decker 13 nwburg template
  • Loading branch information
monofon committed Jan 15, 2023
2 parents 565e6b1 + bdb29b1 commit f4bc28b
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 50 deletions.
9 changes: 6 additions & 3 deletions bin/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@ if (-Not $skiptemplates) {
<# Cleanup of old files #>
Write-Host "Cleaning before new build" -ForegroundColor Green
& stack clean
Remove-Item "$deckerdir\resource\decker\support\vendor" -Recurse -Force -ErrorAction Continue
Remove-Item "$deckerdir\public" -Recurse -Force -ErrorAction Ignore

if (test-path "$deckerdir\resource\decker\support\vendor") {
Remove-Item "$deckerdir\resource\decker\support\vendor" -Recurse -Force -ErrorAction Continue
}
if (test-path "$deckerdir\public"){
Remove-Item "$deckerdir\public" -Recurse -Force -ErrorAction Ignore
}


Write-Host "Starting build of standalone binary" -ForegroundColor Green
Expand Down
5 changes: 3 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ local-bin-path := $(HOME)/.local/bin

decker-name := $(base-name)-$(version)-$(branch)-$(commit)

.PHONY: build clean test install list dist docs resource-zip css

build:
stack build -j8
Expand Down Expand Up @@ -87,5 +88,5 @@ clean-recordings:
rm -f test/decks/*-recording*
rm -f test/decks/*-times.json
rm -f test/decks/*-annot.json

.PHONY: build clean test install dist docs resource-zip css
list:
@LC_ALL=C $(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/(^|\n)# Files(\n|$$)/,/(^|\n)# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
24 changes: 22 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ A markdown based tool for slide deck creation.
4. `git submodule update --init --recursive`
5. `make install`

Note:

Decker will be installed under `~/.local/bin` which is default not recognized by your terminal.
If decker is not found by your terminal, add the path to the corresponding config file.
For zsh (default for macos) do the following steps. Run from the terminal:

1. `touch ~/.zshrc`
2. `echo PATH=$HOME/.local/bin:$PATH > ~/.zshrc`
3. `source ~/.zshrc`

## Installation from source on Windows

Instead of a `makefile` we use a PowerShell script on Windows to install decker
Expand All @@ -33,6 +43,14 @@ session!

`$Env:Path += ";${Env:ProgramFiles(x86)}\Decker\bin"`

### Note:

Windows Antivirus Protection has a high impact on compilation time. Add the following directories as exclusions to safe about 20-40% compilation time.

- Haskell stack build tool: usually under `C:\sr`
- Haskell compiler: `%AppData%\Local\Programs\stack\x86_64-windows\ghc-x.x.x\bin`
- this repository

## Development

### Haskell
Expand All @@ -58,6 +76,8 @@ the full functionality:
- [*ssh*](https://www.openssh.com) for publishing slide decks and resources
- [*rsync*](http://formulae.brew.sh/repos/Homebrew/homebrew-core/formula/rsync)
for publishing slide decks and resources
- Note: openssh Server do not work properly with rsync for Windows. Use cygwin and its terminal to perform decker publish.

- [*LaTeX* with pdflatex](https://www.latex-project.org) to generate LaTeX in
PDF-files and embedded Tikz figures
- [*Graphviz*](http://graphviz.org) to generate graphs using `dot`
Expand Down Expand Up @@ -90,7 +110,7 @@ Use [Ubuntu's Advanced Packaging Tool
tools.

``` sh
apt-get update && apt-get install -y gnuplot graphviz libbz2-dev pdf2svg rsync ssh
apt-get update && apt-get install -y gnuplot graphviz libbz2-dev pdf2svg rsync ssh libtinfo-dev
```

To confirm that you have installed all of the required external tools, run the
Expand Down Expand Up @@ -201,7 +221,7 @@ document, depending on the file name.
Publish the generated files to a remote location using `rsync` if the
location is specified in the meta data. The keys `rsync-destination.host`
and `rsync-destination.path` specify the publishing destination.

## Contributions

### Pull requests
Expand Down
52 changes: 9 additions & 43 deletions resource/nwburg/template/deck.html
Original file line number Diff line number Diff line change
Expand Up @@ -216,49 +216,15 @@
]
};

console.log(3);
Reveal.initialize(revealConfig).then(() => {
const hljs = highlightPlugin().hljs;

// Here you can call functions on hljs, e.g. registerLanguage and configure
hljs => hljs.registerLanguage(
"asm6502acme",
(() => {
"use strict";
return (r) => ({
name: "asm6502acme",
case_insensitive: true,
keywords: {
keyword:
"ADC AND ASL BCC BCS BEQ BIT BMI BNE BPL BRK BVC BVS CLC CLD CLI CLV CMP CPX CPY DEC DEX DEY EOR INC INX INY JMP JSR LDA LDX LDY LSR NOP ORA PHA PHP PLA PLP ROL ROR RTI RTS SBC SEC SED SEI STA STX STY TAX TAY TSX TXA TXS TYA",
built_in: "x|0 y|0",
symbol:
"scr by byte txt pet to source binary initmem wo word hex h align fi fill skip convtab ct text tx raw scrxor zone sl if ifdef ifndef for set do while endoffile warn error serious macro pseudopc cpu to al as rl rs",
},
contains: [
r.COMMENT(";", "$", { relevance: 0 }),
{
className: "number",
begin:
"(-?)(\\$[a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",
},
r.QUOTE_STRING_MODE,
{
className: "string",
begin: "'",
end: "[^\\\\]'",
illegal: "[^\\\\][^']",
},
{ className: "symbol", begin: "^![A-Za-z0-9_.$]+:" },
],
});
})()
);
// Run the plugin's highlighting code that was skipped on load
Array.from(Reveal.getRevealElement().querySelectorAll('pre code')).forEach((block) => {
highlightPlugin().highlightBlock(block);
});
});
Reveal.initialize(revealConfig);

/* TODO: Highlight JS tries to highlight assembly code within the lecture.
ATM if tries to interpret more than just the assembly code on the slides,
and thus decker fails to compile.
We do have to fix this before adding it back to a release.
See commit 565e6b1 for original source. For some reason, comment the responsible
code section does not work. Neither client /server side html nor js comment.
It is still interpreted. Therefore the code has been removed */

window.Reveal = Reveal;
</script>
Expand Down

0 comments on commit f4bc28b

Please sign in to comment.