From 1293c214db032ca473b2b2ff54acd8e3f7e83d0a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Tue, 6 Jun 2023 16:45:34 +0200 Subject: [PATCH] help and assist for editor --- pages/[wiki]/editorhelp/#page.md | 31 ++++++++++++++++++++++++++++++ themes/default.css | 33 +++++++++++++++++++++++++++++++- themes/default.sh | 30 ++++++++++++++++++++++++++--- 3 files changed, 90 insertions(+), 4 deletions(-) create mode 100644 pages/[wiki]/editorhelp/#page.md diff --git a/pages/[wiki]/editorhelp/#page.md b/pages/[wiki]/editorhelp/#page.md new file mode 100644 index 0000000..930fda3 --- /dev/null +++ b/pages/[wiki]/editorhelp/#page.md @@ -0,0 +1,31 @@ +### Formatting: + +\*\***strong**\*\* \**emphasized*\* `~~`~~strikethrough~~`~~` \``verbatim`\` + +a backslash `\` prevents \*\*accidental formatting\*\*: \\\* \\\` + +### Links: + +Simple Weblink (use angle brackets): < > + +Simple Email Link: < > + +Weblink with Text: \[Wikipedia article\](https://en.wikipedia.org/wiki/Markdown) - [Wikipedia article](https://en.wikipedia.org/wiki/Markdown) + +Other pages on the same site: +[Start page](/): `[Start page](/)`, [Help](/[wiki]/editorhelp/): `[Help](/[wiki]/editorhelp/)` + + +### Lists: + ++----------------------------------+---------------------+ +| [space] [dash] [space] [text] | - bullet | +| - bullet | - list | +| - list | - indented point | +| - indented point | | ++------------------------------------------+---------------------+ +| [space] [number] [dot] [space] [text] | 1. ordered | +| 1. ordered | 2. list | +| 2. list | 1. indented point| +| 1. indented point | | ++------------------------------------------+---------------------+ diff --git a/themes/default.css b/themes/default.css index 7ef7fb3..e23c182 100644 --- a/themes/default.css +++ b/themes/default.css @@ -114,11 +114,42 @@ main pre { body[id$="/[edit]"] textarea, body[id$="/[newpage]"] textarea { width: 100%; - min-height: 20em; min-height: 70vh; + min-height: 20em; min-height: 50vh; font-family: monospace; font-size: inherit; } +[id$="/[edit]"] main { + padding-top: 2.5em; +} +[id$="/[edit]"] input[type=radio].tab ~ div.tab.syntax, +[id$="/[edit]"] input[type=radio].tab ~ div.tab.help { + background-color: #FFF; + min-height: 20em; min-height: 50vh; +} +[id$="/[edit]"] input[type=radio].tab#edtr:checked ~ form.tab.editor { display: block; } +[id$="/[edit]"] input[type=radio].tab#help:checked ~ div.tab.syntax { display: block; } +[id$="/[edit]"] input[type=radio].tab#himg:checked ~ div.tab.help, +[id$="/[edit]"] input[type=radio].tab#hdoc:checked ~ div.tab.help { + display: block; +} +[id$="/[edit]"] input[type=radio].tab ~ div.tab.help .himg, +[id$="/[edit]"] input[type=radio].tab ~ div.tab.help .hdoc { + display: none; +} +[id$="/[edit]"] input[type=radio].tab ~ div.tab.help { + padding-top: 1em; + padding-left: 7em; +} +[id$="/[edit]"] input[type=radio].tab ~ div.tab.help .himg img { + float: left; + max-height: 4em; + margin-left: -6em; +} +[id$="/[edit]"] input[type=radio].tab#himg:checked ~ div.tab.help .himg { display: block; } +[id$="/[edit]"] input[type=radio].tab#hdoc:checked ~ div.tab.help .hdoc { display: block; } + + /* === Attachments === */ .attachment.list button[name=delete] { diff --git a/themes/default.sh b/themes/default.sh index 541f713..d82764b 100755 --- a/themes/default.sh +++ b/themes/default.sh @@ -68,19 +68,43 @@ theme_page(){ } theme_editor(){ - local page="$1" template="$2" title - title="${page%/}"; title="${title##*/}" + local page="$1" template="$2" title file att + title="$(HTML "${PAGE_TITLE:-"${page}"}")" [ "$template" ] && acl_read "$template" || template="$page" theme_page - "Editor: $title" <<-EOF -
+ + + + +
+
$(wiki "/[wiki]/editorhelp/")
+
+ $(for file in "$_EXEC/pages/${page%/:$LANGUAGE/}/#attachments"/* "$_DATA/pages/${page%/:$LANGUAGE/}/#attachments"/*; do + [ "$file" = "$_EXEC/pages/${page%/:$LANGUAGE/}/#attachments/${file##*/}" \ + -a -f "$_DATA/pages/${page%/:$LANGUAGE/}/#attachments/${file##*/}" ] && continue + case ${file##*/} in + \*) continue;; + *.[pP][nN][gG]|*.[jJ][pP][gG]|*.[jJ][pP][eE][gG]|*.[gG][iI][fF]) + [ "$page" != "${page%/:$LANGUAGE/}" ] && p=../ || p='' + att="$(HTML "${file##*/}")" + printf '

![](%s)

  • [%s]([attachment]/%s)
  • [![%s](%s)]([attachment]/%s)
' \ + "$p" "$att" "$att" "$att" "$att" "$att" "$att" "$att" + ;; + *) + att="$(HTML "${file##*/}")" + printf '

[%s](%s)

' "$att" "$att" + ;; + esac + done) +
EOF } -- 2.39.2