diff --git a/README.md b/README.md index 809d4bd..26eb06e 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,36 @@ -# Practice Guide +# PRACTICE GUIDE A generic version of the Practice Guide for Computer without the dependency on LaTeX. -You will instead need just groff and m4. +View original here: +https://codeberg.org/oneirophage/practice-guide-for-computer -View original here: +## YOU WILL NEED + +- m4: change MUSIC to COMPUTER. (Note to self: Why not just use sed?) https://www.gnu.org/software/m4/manual/m4.html +- groff: pdf output. https://www.gnu.org/software/groff/manual/groff.html +- mustache: for templating. https://mustache.github.io/ +- xq: a wrapper for jq that adds support for xml. https://kislyuk.github.io/yq/#xml-support + +## YOU WILL FIND HERE + +``` +. +├── README.md +├── guide.pdf +├── justfile +└── src + ├── guide.tmac + ├── guide.tmpl + └── guide.xml + +2 directories, 6 files +``` + +1. README.md: you're reading it! +2. guide.pdf: the output +3. justfile: build command +4. guide.tmac: some groff helper macros +5. guide.tmpl: the mustache template that creates the groff +6. guide.xml: the actual document source diff --git a/guide.ms b/guide.ms deleted file mode 100644 index 5add3f1..0000000 --- a/guide.ms +++ /dev/null @@ -1,80 +0,0 @@ -define(`MUSIC',`COMPUTER')dnl -. -. -. -.de Heading -.sp -.SH -.LG -.B "\\$*" -.sp -.. -. -. -. -.ce 2 -.ps 21 -.B "Practice Guide for MUSIC" -.ps -.sp -Adapted from oneirophage's practice-guide-for-computer\** -.FS -https://codeberg.org/oneirophage/practice-guide-for-computer -.FE -.sp -.LP -.ps 16 -Before starting your daily practice routine, read and seriously consider the following: -. -. -.Heading "A.\h'1m'DAILY AFFIRMATIONS" -.RS -.nr i 0 1 -.IP \n+[i] 2m -How fortunate I am that in this life I am one who has been allowed to create beauty with MUSIC. -.IP \n+[i] 2m -It is my responsibility to create peace, beauty, and love with MUSIC. -.RE -. -. -. -.Heading "B.\h'1m'I WILL BE KIND TO MYSELF" -.RS -.nr i 0 1 -.IP \n+[i] 2m -IT IS ONLY MUSIC -.IP \n+[i] 2m -No matter my level of development in MUSIC, how good or bad I think I am, it is only MUSIC and I am a beautiful person. -.IP \n+[i] 2m -I will not compare myself with my colleagues. If they do MUSIC beautifully, I will enjoy it and be thankful and proud that I live in fellowship with them. -.IP \n+[i] 2m -There will always be someone with more abilities in MUSIC than my own as there will be those with less. -.RE -. -. -. -.Heading "C.\h'1m'REASONS TO DO MUSIC" -.RS -.nr i 0 1 -.IP \n+[i] 2m -To contribute to the world's spiritual growth. -.IP \n+[i] 2m -To contribute to my own self-discovery and spiritual growth. -.IP \n+[i] 2m -To pay homage to all the great practitioners of MUSIC, past and present, who have added beauty to the world. -.RE -. -. -. -.Heading "D.\h'1m'RID YOUR SELF OF THE FOLLOWING REASONS FOR BEING A PRACTITIONER OF MUSIC" -.RS -.nr i 0 1 -.IP \n+[i] 2m -To create self-esteem -.IP \n+[i] 2m -To be "hip" -.IP \n+[i] 2m -To manipulate -.IP \n+[i] 2m -To get rich or famous -.RE diff --git a/guide.pdf b/guide.pdf index 5031473..3546b43 100644 Binary files a/guide.pdf and b/guide.pdf differ diff --git a/guide.txt b/guide.txt deleted file mode 100644 index b554e9f..0000000 --- a/guide.txt +++ /dev/null @@ -1,59 +0,0 @@ - - - Practice Guide for COMPUTER - - -Before starting your daily practice routine, read and seriously -consider the following: - - -A. DAILY AFFIRMATIONS - - - 1 How fortunate I am that in this life I am one who has been - allowed to create beauty with COMPUTER. - - 2 It is my responsibility to create peace, beauty, and love - with COMPUTER. - - -B. I WILL BE KIND TO MYSELF - - - 1 IT IS ONLY COMPUTER - - 2 No matter my level of development in COMPUTER, how good or - bad I think I am, it is only COMPUTER and I am a beautiful - person. - - 3 I will not compare myself with my colleagues. If they do - COMPUTER beautifully, I will enjoy it and be thankful and - proud that I live in fellowship with them. - - 4 There will always be someone with more abilities in COM- - PUTER than my own as there will be those with less. - - -C. REASONS TO DO COMPUTER - - - 1 To contribute to the world's spiritual growth. - - 2 To contribute to my own self-discovery and spiritual - growth. - - 3 To pay homage to all the great practitioners of COMPUTER, - past and present, who have added beauty to the world. - - -D. RID YOUR SELF OF THE FOLLOWING REASONS FOR BEING A PRACTI- -TIONER OF COMPUTER - - - 1 To create self-esteem - - 2 To be "hip" - - 3 To manipulate - - 4 To get rich or famous diff --git a/justfile b/justfile index b8afb4d..89dcfc2 100644 --- a/justfile +++ b/justfile @@ -1,5 +1,5 @@ -build: - m4 guide.ms | groff -Tpdf -ms > guide.pdf - -watch: - ls guide.ms | entr -r just build +pdf: + m4 -DMUSIC=COMPUTER src/guide.xml \ + | xq . \ + | mustache - src/guide.tmpl \ + | groff -Tpdf -ms > guide.pdf diff --git a/src/guide.tmac b/src/guide.tmac new file mode 100644 index 0000000..51af4e4 --- /dev/null +++ b/src/guide.tmac @@ -0,0 +1,25 @@ +.de Heading +.sp +.SH +.IP \f[B]\s+2\\n+[HX].\s0\f[] 5n +.B +.LG +\\$* +.sp +.. +. +. +.de UL +.ie !"\\$1"" \{\ +. RE\} +.el \{\ +. RS +. nr idx 0 1\} +.. +. +. +.de li +.IP \\n+[idx]. 2m +\\$* +.. + diff --git a/src/guide.tmpl b/src/guide.tmpl new file mode 100644 index 0000000..8764c41 --- /dev/null +++ b/src/guide.tmpl @@ -0,0 +1,36 @@ +{{#doc}} +.nr HY 0 \" Turn off hypenation +.nr HX 0 1 +.af HX A +.so src/guide.tmac +. +. +. +{{#header}} +.\" HEADER +.ce 2 +.ps 21 +.B "{{title}}" +.ps +.sp +.LP +.ps 16 +.vs 16 +{{tagline}} +.\" END HEADER +{{/header}} +. +. +. +{{#main}} +.\" MAIN +{{#section}} +.Heading {{title}} +. UL +{{#item}} +. li {{{.}}} +{{/item}} +. UL OFF +{{/section}} +{{/main}} +{{/doc}} diff --git a/src/guide.xml b/src/guide.xml new file mode 100644 index 0000000..d3580b7 --- /dev/null +++ b/src/guide.xml @@ -0,0 +1,33 @@ + +
+ Practice Guide for MUSIC + Before starting your daily practice routine, read and seriously consider the following: +
+
+
+ DAILY AFFIRMATIONS + How fortunate I am that in this life I am one who has been allowed to create beauty with MUSIC. + It is my responsibility to create peace, beauty, and love with MUSIC. +
+
+ I WILL BE KIND TO MYSELF + IT IS ONLY MUSIC + No matter my level of development in MUSIC, how good or bad I think I am, it is only MUSIC and I am a beautiful person. + I will not compare myself with my colleagues. If they do MUSIC beautifully, I will enjoy it and be thankful and proud that I live in fellowship with them. + There will always be someone with more abilities in MUSIC than my own as there will be those with less. +
+
+ REASONS TO DO MUSIC + To contribute to the world's spiritual growth. + To contribute to my own self-discovery and spiritual growth. + To pay homage to all the great practitioners of MUSIC, past and present, who have added beauty to the world. +
+
+ RID YOUR SELF OF THE FOLLOWING REASONS FOR BEING A PRACTITIONER OF MUSIC + To create self-esteem + To be "hip" + To manipulate + To get rich or famous +
+
+