From c7b637471fdd75f64415728690c012da52017f61 Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 3 Jul 2014 22:21:38 +0200 Subject: [PATCH 1/1] Improvement of documentation of my plugins - typos - examples - rendering - explanation - update - etc. --- doc/plugins/contrib/addtag.mdwn | 1 + doc/plugins/contrib/created_in_future.mdwn | 1 + doc/plugins/contrib/datetime_cmp.mdwn | 3 +- doc/plugins/contrib/jscalendar.mdwn | 25 +++-- doc/plugins/contrib/monthcalendar.mdwn | 106 +++++++++++++++++++++ doc/plugins/contrib/parenttag.mdwn | 1 + doc/plugins/contrib/poetry.mdwn | 12 ++- doc/plugins/contrib/sidebar2.mdwn | 5 +- doc/plugins/contrib/taskreport.mdwn | 1 + doc/users/spalax.mdwn | 5 +- 10 files changed, 140 insertions(+), 20 deletions(-) diff --git a/doc/plugins/contrib/addtag.mdwn b/doc/plugins/contrib/addtag.mdwn index ed57202d8..5b9461d28 100644 --- a/doc/plugins/contrib/addtag.mdwn +++ b/doc/plugins/contrib/addtag.mdwn @@ -1,3 +1,4 @@ +[[!meta author="spalax"]] [[!template id=plugin name=addtag author="[[Louis|spalax]]"]] [[!tag type/widget]] diff --git a/doc/plugins/contrib/created_in_future.mdwn b/doc/plugins/contrib/created_in_future.mdwn index 09d2d52fc..95793e12a 100644 --- a/doc/plugins/contrib/created_in_future.mdwn +++ b/doc/plugins/contrib/created_in_future.mdwn @@ -1,3 +1,4 @@ +[[!meta author="spalax"]] [[!template id=plugin name="created_in_future (deprecated)" author="[[Louis|spalax]]"]] # Created_in_future diff --git a/doc/plugins/contrib/datetime_cmp.mdwn b/doc/plugins/contrib/datetime_cmp.mdwn index 7508e0b21..ba35b37c6 100644 --- a/doc/plugins/contrib/datetime_cmp.mdwn +++ b/doc/plugins/contrib/datetime_cmp.mdwn @@ -1,3 +1,4 @@ +[[!meta author="spalax"]] [[!template id=plugin name=datetime_cmp author="[[Louis|spalax]]"]] [[!tag type/pagespec]] @@ -36,7 +37,7 @@ where: * `page`: other page (given in argument); * `now`: date or time of compilation; * `today`: same meaning as `now`. - * `(|_delta)`: used to add a time delta (to use comparisons such as *created at least two day after `some_page`*): + * `(|_delta)`: used to add a time delta (to use comparisons such as *created at least two days after `some_page`*): * *empty*: no delta; * `_delta`: delta (given in argument). diff --git a/doc/plugins/contrib/jscalendar.mdwn b/doc/plugins/contrib/jscalendar.mdwn index 794e4bd9c..8123b3132 100644 --- a/doc/plugins/contrib/jscalendar.mdwn +++ b/doc/plugins/contrib/jscalendar.mdwn @@ -1,3 +1,4 @@ +[[!meta author="spalax"]] [[!template id=plugin name=jscalendar author="[[Louis|spalax]]"]] # Jscalendar @@ -12,33 +13,37 @@ Here are some differences compared to this latter plugin. * No need to rebuild the page containing the calendar each time day changes, or a page (indexed by the calendar) is added, changed or deleted. This is particularly useful if you want to have this calendar in the sidebar. - * Handles the case where several pages appear the same day: a popup appear to let user choose the day he wants. * Smooth navigation among months. -* Neutral - * Most of options are defined in Ikiwiki's setup files instead of the options - of the directive. * Cons - * As a consequence, every calendar of the wiki must index the same set of pages. * Javascript :( . ## Usage -### Directive +### Examples of directive \[[!jscalendar type="month" ]] + \[[!jscalendar type="month" archivebase="calendar"]] + + \[[!jscalendar type="month" year=2014 month=08 pages="posts/* and !posts/*"]] + + \[[!jscalendar type="month" year=-1 month=08]] + ### Setup file -It being javascript rather than markdown, most of the configuration must be done in the IkiWiki configuration file rather than in the directive +This plugin uses the options used by the [[plugins/calendar]] plugin: - 'archivebase' => "evenements/calendrier", - 'archive_pagespec' => "evenements/liste/* and ! evenements/liste/*/*", + 'archivebase' => "archive", + 'archive_pagespec' => "posts/* and ! posts/*/*", 'week_start_day' => 1, 'month_link' => 1, +The `archivebase` and `archive_pagespec` can be overloaded by the very same +options of the directive. + ## Example -You can see this plugin in action on [[our website|http://www.gresille.org]]. To see what happens when several pages happens on the same day, check the 15th of March 2012. +You can see this plugin in action on [[our website|http://www.gresille.org]]. Code and documentation can be found here : [[https://atelier.gresille.org/projects/gresille-ikiwiki/wiki/Jscalendar]] diff --git a/doc/plugins/contrib/monthcalendar.mdwn b/doc/plugins/contrib/monthcalendar.mdwn index 4944f3a8f..c21be0abe 100644 --- a/doc/plugins/contrib/monthcalendar.mdwn +++ b/doc/plugins/contrib/monthcalendar.mdwn @@ -1,9 +1,12 @@ +[[!meta author="spalax"]] [[!template id=plugin name=monthcalendar author="[[Louis|spalax]]"]] # Monthcalendar This plugin displays a calendar, containing in each of its day the list of links of pages published on this day. It can be used, for example, to display archives of blog posts, or to announce events. +The difference between this plugin and the [[plugins/calendar]] plugin is that the calendar displayed by this plugin is a big one, containing the full title of every page indexed in it. + ## Usage ### Directive @@ -16,6 +19,109 @@ By using the following line in template `calendarmonth.tmpl`, you can have `ikiw \[[!monthcalendar type="month" year="" month="" pages=""]] +## CSS + +Here is an example of CSS properly rendering the calendar produced by this +plugin. +[[!toggle id=css text="CSS"]] +[[!toggleable id=css text=""" + /* Calendar */ + .monthcalendar + { + color:#aaa; + /* font-size:18pt; */ + margin-top:1em; + margin-bottom:1em; + width: 100%; + } + + .monthcalendar table, + .monthcalendar td, + .monthcalendar th + { + border: 1px solid #ccc; + } + + #content .monthcalendar td + { + padding: 0; + position: relative; + } + + .monthcalendar td div + { + min-height: 10ex; + height: 100%; + position: relative; + } + + .monthcalendar th + { + vertical-align: middle; + } + + .monthcalendar td ul + { + padding-left: 0.5em; + list-style: dot; + list-style-position: inside; + text-align: left; + font-size: 8pt; + position: relative; + z-index: 10; + font-weight: bold; + } + + table.monthcalendar + { + table-layout: fixed; + } + + .monthcalendar .selflink + { + color:#444444; + } + + .monthcalendar-day-head { + text-transform:capitalize; + } + + .monthcalendar-head { + text-transform:capitalize; + } + + .monthcalendar-daynumber + { + float: left; + position: absolute; + display: block; + font-size: 7ex; + color: #ccc; + line-height: 100%; + z-index: 5; + padding-top: 0.3ex; + text-align: right; + width: 1.8em; + } + + /* List of pages */ + + .monthcalendar-pagelist { + display: flex; + flex-direction: column; + } + + .monthcalendar-item { + opacity: 0; + height: 0; + } + + .monthcalendar-item:target { + opacity: 1; + height: initial; + } +"""]] + ## Code Code and documentation can be found here : [[https://atelier.gresille.org/projects/gresille-ikiwiki/wiki/Monthcalendar]]. diff --git a/doc/plugins/contrib/parenttag.mdwn b/doc/plugins/contrib/parenttag.mdwn index d3bede797..5dc01c7c5 100644 --- a/doc/plugins/contrib/parenttag.mdwn +++ b/doc/plugins/contrib/parenttag.mdwn @@ -1,3 +1,4 @@ +[[!meta author="spalax"]] [[!template id=plugin name=parenttag author="[[Louis|spalax]]"]] [[!tag type/tags]] diff --git a/doc/plugins/contrib/poetry.mdwn b/doc/plugins/contrib/poetry.mdwn index 519975e40..aed2e420a 100644 --- a/doc/plugins/contrib/poetry.mdwn +++ b/doc/plugins/contrib/poetry.mdwn @@ -1,3 +1,4 @@ +[[!meta author="spalax"]] [[!template id=plugin name=poetry author="[[Louis|spalax]]"]] # Poetry @@ -10,12 +11,15 @@ render poetry (or songs). ### Typography In regular text, there are two different meaning of a new line: a break between -two paragraphs, and the word wrap. +two paragraphs, and the line wrap. When rendering poetry, we need a third one: the carriage return between two -verse lines. This one should be different from the word wrap carriage return, -otherwise one will not be able to tell apart these two (generally, wrapped text -is indented, whereas verse lines are not). +verse lines. This one should be different from the line wrap carriage return, +otherwise one will not be able to tell apart these two: is a word displayed at +the begenning of its line a new verse line, or the previous verse line, +continuing on a new line because it is too long? + +Generally, wrapped text is indented, whereas verse lines are not. ### Markdown diff --git a/doc/plugins/contrib/sidebar2.mdwn b/doc/plugins/contrib/sidebar2.mdwn index 574bdeaab..5c169bfd4 100644 --- a/doc/plugins/contrib/sidebar2.mdwn +++ b/doc/plugins/contrib/sidebar2.mdwn @@ -1,9 +1,10 @@ +[[!meta author="spalax"]] [[!template id=plugin name=sidebar2 author="[[Louis|spalax]]"]] [[!tag type/chrome]] *Claim:* The [[sidebar|plugins/sidebar]] plugin has nothing to do with sidebars. This plugin renders some page (which happens to be named -`sidebar`) and put the result in template variable `SIDEBAR`, in template +`sidebar`) and put the result in template variable `SIDEBAR` of template `page.tmpl`. But the fact that it is a sidebar, i.e. a bar appearing on the side on the screen, is done by CSS. @@ -40,7 +41,7 @@ The default, which gives the behaviour of the sidebar plugin, is # Improvements over sidebar plugin -* You can add several "sidebars" to your wiki. For example, to have a sidebar, a submeno that appear only in pages documentations, and a footer, your `global_sidebars` would be: +* You can add several "sidebars" to your wiki. For example, to have a sidebar, a submenu that appears only in documentation pages (`doc/*`), and a footer, your `global_sidebars` would be: global_sidebars => [ "sidebar", "sidebar", "*", diff --git a/doc/plugins/contrib/taskreport.mdwn b/doc/plugins/contrib/taskreport.mdwn index 38c2a10c4..377c9ed39 100644 --- a/doc/plugins/contrib/taskreport.mdwn +++ b/doc/plugins/contrib/taskreport.mdwn @@ -1,3 +1,4 @@ +[[!meta author="spalax"]] [[!template id=plugin name=taskreport author="[[Louis|spalax]]"]] # Taskreport diff --git a/doc/users/spalax.mdwn b/doc/users/spalax.mdwn index 0727276a1..d5867ca9e 100644 --- a/doc/users/spalax.mdwn +++ b/doc/users/spalax.mdwn @@ -6,15 +6,14 @@ User of IkiWiki. I wrote and maintain a few plugins, which are available here: [[https://atelier.gresille.org/projects/gresille-ikiwiki]]. -[[!map pages="plugins/contrib/* and ! plugins/contrib/*/* and link(.)"]] +[[!map pages="plugins/contrib/* and ! plugins/contrib/*/* and author(spalax)"]] # Wishlist I have a few things in mind. Their status is something between *I will implement it someday* to *maybe someone could need this* or *I will need it if I implement this killer website I have in mind*. -* [[plugins/contrib/jssearchtag]]: Create a page where user can tick or untick any combination of tag (s)he want, and dynamically sees an inline of the matching pages. I have to see to what extent the [[plugins/contrib/jssearchfield|jssearchfield]] plugin already does the same thing (not tested yet). * [[plugins/contrib/htaccessmanager]]: Create a cgi page to manage a htaccess file. -* Automatically add calendar pages (see the [[ikiwiki-calendar discussion|ikiwiki-calendar/discussion]]). +* Automatically add calendar pages (WIP: see the [[ikiwiki-calendar discussion|ikiwiki-calendar/discussion]]). # Contact -- 2.44.0