From 3954bfff8efe90e5328946827c3159daa56e181b Mon Sep 17 00:00:00 2001 From: notnull Date: Wed, 30 Jan 2019 00:44:03 -0800 Subject: [PATCH] updated pandoc.sh --- docs/org/emacs.org | 3 +++ docs/scripts/pandoc.sh | 38 ++++++++++++++------------------------ 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/docs/org/emacs.org b/docs/org/emacs.org index 190cbdb..b8e8140 100644 --- a/docs/org/emacs.org +++ b/docs/org/emacs.org @@ -154,3 +154,6 @@ C-h a to search for commands tiling window: C-x [1..3] C-k cut C-y paste show only headlines: navigate to first heading and do C-c C-k +[[~/src/dox/docs/org/emacs.org][emacs goodies]] +* IDEA How to turn IDEA into a recognized keyword? +^^^ like this; also it can be done globally, that's a choice to be made. diff --git a/docs/scripts/pandoc.sh b/docs/scripts/pandoc.sh index e96b8a7..0a5a54e 100755 --- a/docs/scripts/pandoc.sh +++ b/docs/scripts/pandoc.sh @@ -1,14 +1,19 @@ #!/bin/bash +# set root path here? (currently this script is in script/, so org/ is ../) +# another 'trick' to fix the path is +dir=$(dirname $0/..) +# or +cd $(dirname $0/..) # $0 contains the full path to the script # -s makes the doc a standalone document instead of a snippet for doc in org/*.org do - # this will return a list of files like 'org/somefile.org' - # to only get the filename we could enter the folder or - # use sed to replace it by regex or use basename. + # This will return a list of files like 'org/somefile.org'. + # To only get the filename we use sed and use basename. + filename=$(basename $doc) # we want to get rid of .org nosuffix=$(echo "$filename"|sed -E "s/\.org$//") - # this looks terrible, i know. -E makes it POSIX compatible + # -E makes it POSIX compatible # $ locks it to the end, ^ to the beginning # * . ( ) { } [ ] need to be escaped with \ htmlfile="html/$nosuffix.html" @@ -19,28 +24,13 @@ do sed -E "s/(<\/title>)/\1\n /" | \ sed -E "s/()/\1\n
\n/" | \ sed -E "s/(<\/body>)/\n<\/div>\n\1>/" > $htmlfile - + # The Skeleton template requires that everything is wrapped in a + # div class="container". + pandoc -s $doc -o md/$nosuffix.md -# lets try! - # after this, I would like to do a bit of styling, but not sure what -# that looks like yet. maybe done in CSS instead . -# search and replace? it depends on how the CSS is. -# The Skeleton template requires that everything is wrapped in a -# div class="container" for example, but we could put the container -# styling on body instaed. etc. Whatever has the least overhead. - -done # thanks emacs! +done # one time only pandoc org/README.org -o ./README.md - - - - -# one more thing: we need to write the link to the css stylesheet... one sec - - - -# fi! - +pandoc org/index.org -o ./index.html