From 0d5a47831d81de504a47dc8c864b42ef8f4df0ee Mon Sep 17 00:00:00 2001 From: speedie Date: Sat, 12 Nov 2022 15:31:53 +0100 Subject: [PATCH] Add CSS, various more options, we can now make php :D --- Makefile | 46 ++++++++++++++++++++++++++++++------ README.md | 2 +- docs/doc-07 | 1 + docs/example.Xresources | 1 + docs/speedwm.css.template | 4 ++++ docs/speedwm.html.template.1 | 30 ++++++++--------------- docs/speedwm.html.template.2 | 6 ++--- host.mk | 4 ++-- scripts/speedwm-help | 2 +- scripts/speedwm-mkpage | 5 ++-- 10 files changed, 65 insertions(+), 36 deletions(-) create mode 100644 docs/speedwm.css.template diff --git a/Makefile b/Makefile index 0b71683..c260e01 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,7 @@ endif clean: rm -f speedwm *.o speedwm-${VERSION}.tar.gz rm -f speedwm-ipc + rm -f *.html *.php echo "Cleaned!" dist: clean @@ -158,15 +159,20 @@ help: @echo help: Displays this help sheet. @echo docs: View documentation for speedwm @echo html: Write HTML document based on documentation. + @echo php: Write PHP document based on documentation. This is almost identical to html. @echo markdown: Write Markdown document based on documentation. @echo readme: Write output of speedwm-help -a to readme. @echo upload: git commit and git push this build. @echo @echo - Page - - @echo page: Creates the https://speedie.gq/speedwm page in HTML form. - @echo page_install: Copy the page to ${HTMLDIR}. - @echo page_push: git commit and git push the page in ${HTMLDIR}. + @echo page: Creates the https://speedie.gq/speedwm page in PHP form. + @echo page_php: Creates the https://speedie.gq/speedwm page in PHP form. + @echo page_html: Creates the https://speedie.gq/speedwm page in HTML form. + @echo page_install: Copy the page to ${PAGEDIR} and copy the preview image. + @echo page_push: git commit and git push the page in ${PAGEDIR}. @echo page page_install page_push to do all of the above page changes instantly. + @echo css_install: Copy the CSS from docs/ to ${PAGEDIR} + @echo previmg_install: Copy the preview image to ${PAGEDIR} @echo @echo - Releasing - @echo release to run make markdown, make upload, make page, make page_install, make page_push instantly. @@ -231,16 +237,36 @@ upload: @echo "Uploaded everything." page: + make page_php + +page_html: chmod +x scripts/speedwm-mkpage chmod +x scripts/speedwm-help ./scripts/speedwm-mkpage -mkpage +page_php: + chmod +x scripts/speedwm-mkpage + chmod +x scripts/speedwm-help + ./scripts/speedwm-mkpage -mkpage + mv readme.html readme.php + page_install: - cp speedwm.html ${HTMLDIR} - @echo "Copied speedwm.html to ${HTMLDIR}." + [ -f readme.html ] && cp -f readme.html ${PAGEDIR}/speedwm.html || \ + [ -f readme.php ] && cp -f readme.php ${PAGEDIR}/speedwm.php || : + make previmg_install + make css_install + @echo "Copied readme.html/php to ${PAGEDIR}." + +previmg_install: + [ -f docs/preview.png ] && cp -f docs/preview.png ${PAGEDIR} + @echo "Copied preview image to ${PAGEDIR}/preview.png" + +css_install: + [ -f docs/speedwm.css.template ] && cp -f docs/speedwm.css.template ${PAGEDIR}/speedwm.css || : + @echo "Copied CSS to ${PAGEDIR}." page_push: - echo ${HTMLDIR} > /tmp/speedwm-htmldir + echo ${PAGEDIR} > /tmp/speedwm-htmldir chmod +x scripts/speedwm-mkpage chmod +x scripts/speedwm-help ./scripts/speedwm-mkpage -page-push @@ -249,6 +275,12 @@ html: chmod +x scripts/speedwm-mkpage chmod +x scripts/speedwm-help ./scripts/speedwm-mkpage -mkhtml + +php: + chmod +x scripts/speedwm-mkpage + chmod +x scripts/speedwm-help + ./scripts/speedwm-mkpage -mkpage + mv readme.html readme.php markdown: chmod +x scripts/speedwm-mkpage @@ -260,4 +292,4 @@ readme: chmod +x scripts/speedwm-help ./scripts/speedwm-mkpage -mk -.PHONY: all options clean dist install install_only_bin install_only_misc modules_install uninstall help docs page page_install page_release html markdown readme page_push upload release +.PHONY: all options clean dist install install_only_bin install_only_misc modules_install uninstall help docs page page_html page_php page_install page_release html php markdown readme page_push upload release previmg_install css_install diff --git a/README.md b/README.md index 86b174e..d69eb0c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -# speedwm ![image](/docs/preview.png) ## What is speedwm? @@ -473,6 +472,7 @@ If it is not or you want it somewhere else, you can edit 'autostart.h' and 'make - speedwm.tag.urgentwindows: 1 - speedwm.tiling.resizehints: 0 - speedwm.run.shell: /bin/sh + ## Signals Thanks to the 'fsignal' patch available on suckless.org's website, we can easily write shell scripts to interact with dwm and therefore speedwm. I made some changes to this patch, because it has some.. questionable behaviour in my opinion. diff --git a/docs/doc-07 b/docs/doc-07 index b198c13..5ba251c 100644 --- a/docs/doc-07 +++ b/docs/doc-07 @@ -1,3 +1,4 @@ + -- Signals -- Thanks to the 'fsignal' patch available on suckless.org's website, we can easily write shell scripts to interact with dwm and therefore speedwm. I made some changes to this patch, because it has some.. questionable behaviour in my opinion. diff --git a/docs/example.Xresources b/docs/example.Xresources index de63834..d4b276f 100644 --- a/docs/example.Xresources +++ b/docs/example.Xresources @@ -242,3 +242,4 @@ !! You have reached the bottom of the speedwm config file. !! It may be used as a reference for writing a config file from scratch, or simply copied somewhere and edited. !! Defaults here should more or less represent the settings in the speedwm source code. + diff --git a/docs/speedwm.css.template b/docs/speedwm.css.template new file mode 100644 index 0000000..26e19ea --- /dev/null +++ b/docs/speedwm.css.template @@ -0,0 +1,4 @@ +img { + width: 50%; + padding-left: 10px; +} diff --git a/docs/speedwm.html.template.1 b/docs/speedwm.html.template.1 index cf8681c..a3dce6d 100644 --- a/docs/speedwm.html.template.1 +++ b/docs/speedwm.html.template.1 @@ -1,24 +1,14 @@ + + -
-speedwm // speedie's website + +speedwm - + - - -

speedie's website

- -🏠 Home -πŸ’Ύ Projects -πŸ“˜ Blog -πŸ“• Guides -πŸ“§ Email -🐧 Dotfiles -πŸ“° RSS -πŸ’°Donate - -
-
- + + +Welcome to speedie.gq + -

image

+
diff --git a/docs/speedwm.html.template.2 b/docs/speedwm.html.template.2 index 5764673..7ba0758 100644 --- a/docs/speedwm.html.template.2 +++ b/docs/speedwm.html.template.2 @@ -1,9 +1,9 @@

Auto generated.

This page was auto generated by the speedwm-help script bundled with speedwm. It acts as the help script and it writes documentation to HTML, Markdown and plain text from documentation in the docs folder and data grabbed from your current system.

+
- + diff --git a/host.mk b/host.mk index ea01878..6324873 100644 --- a/host.mk +++ b/host.mk @@ -6,9 +6,9 @@ CC = tcc # Paths # These should be fine for most users but if you use a distribution of GNU/Linux like NixOS or GNU Guix, consider changing this to fit your use case. -# HTMLDIR is only useful if you are using 'make release'. +# PAGEDIR is only useful if you are using 'make release'. PREFIX = /usr -HTMLDIR = "/home/anon/Projects/page" +PAGEDIR = "/home/anon/Projects/page-improved/projects" # GNU/Linux support # If you use GNU/Linux, uncomment these lines (remove the # at the start of the line below) diff --git a/scripts/speedwm-help b/scripts/speedwm-help index 48bfc73..692053a 100755 --- a/scripts/speedwm-help +++ b/scripts/speedwm-help @@ -95,7 +95,7 @@ case "$ARG1" in sed "s|-- Maintaining settings easily --|## Maintaining settings easily|g" | \ sed "s|-- Additional note on autostart --|## Additional note on autostart|g" > ../README.md markdown ../README.md > ../readme.html || printf "\nmarkdown-to-html not found, install using:\nnpm install markdown-to-html -g\n" && exit 1 ;; -"-whtml-wtemplate") test ../readme.html && cat ../docs/speedwm.html.template.1 ../readme.html ../docs/speedwm.html.template.2 >> ../speedwm.html && exit 0 +"-whtml-wtemplate") test ../readme.html && cat ../docs/speedwm.html.template.1 ../readme.html ../docs/speedwm.html.template.2 >> ../readme.temp.html && exit 0 printf "\nYou need to $0 -whtml first." ; exit 1 ;; "") $0 -h && exit 0 ;; "-h") printf "speedwm help\n\nNo arguments to view this list of arguments.\n-h | View this list of arguments.\n-a | View everything.\n-1 | What is speedwm?\n-2 | List of all keybinds\n-3 | List of all dependencies\n-4 | .Xresources/Pywal information.\n-5 | Signals information\n-6 | Switching run launcher\n-7 | Installation\n-8 | Layouts\n-9| Important information.\n-w | Write documentation to ../readme\n-wmd | Write documentation (Markdown)\n-whtml | Write documentation (HTML) using markdown-to-html.\n-whtml-wtemplate | Combine template 1, output of -whtml and template 2 (from docs/) to create a full HTML document.\n\nIf second argument is -o, the requested output will be sent to stdout.\n-o can be replaced with a text editor or reader of your choice (such as less, vim, emacs, etc.)\n"; exit 0 ;; diff --git a/scripts/speedwm-mkpage b/scripts/speedwm-mkpage index 4d244c7..2994607 100755 --- a/scripts/speedwm-mkpage +++ b/scripts/speedwm-mkpage @@ -10,8 +10,9 @@ MKPAGE() { ./speedwm-help -whtml ./speedwm-help -whtml-wtemplate cd .. - rm -f readme.html - echo "Created speedwm.html" + mv readme.temp.html readme.html + sed -i "s|/docs/preview.png|preview.png|g" readme.html + echo "Created readme.html" } PUSHPAGE() {