From 123581d7271ec548869a09a027ad21c0b19e088e Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Sun, 6 Aug 2017 14:16:32 +0200 Subject: [PATCH] [s9y_event_markdown] Add documentation, update German translation. (#66) * [s9y_event_markdown] Update German translation. Signed-off-by: Thomas Hochstein * [s9y_event_markdown] Add documentation. German and English language documentation added. Signed-off-by: Thomas Hochstein * [s9y_event_markdown] Update/change language files. * Add an explicit SmartyPants option instead of a simple "yes". * Change (English and German) language files accordingly. * Change URLs to https to avoid redirects. * Bump version to 1.26 * Update ChangeLog. Signed-off-by: Thomas Hochstein --- serendipity_event_markdown/ChangeLog | 8 + .../UTF-8/lang_de.inc.php | 22 +- .../documentation_de.html | 195 ++++++++++++++++++ .../documentation_en.html | 190 +++++++++++++++++ serendipity_event_markdown/lang_de.inc.php | 22 +- serendipity_event_markdown/lang_en.inc.php | 13 +- .../serendipity_event_markdown.php | 4 +- 7 files changed, 440 insertions(+), 14 deletions(-) create mode 100644 serendipity_event_markdown/documentation_de.html create mode 100644 serendipity_event_markdown/documentation_en.html diff --git a/serendipity_event_markdown/ChangeLog b/serendipity_event_markdown/ChangeLog index 81b9889c..f2d924c0 100644 --- a/serendipity_event_markdown/ChangeLog +++ b/serendipity_event_markdown/ChangeLog @@ -1,3 +1,11 @@ +Version 1.26: +============= +Changes by Thomas Hochstein + +- Some small text changes. +- Update German translation. +- Add English and German documentation. + Version 1.25: ============= Changes by Thomas Hochstein diff --git a/serendipity_event_markdown/UTF-8/lang_de.inc.php b/serendipity_event_markdown/UTF-8/lang_de.inc.php index 6b789671..63165b5c 100644 --- a/serendipity_event_markdown/UTF-8/lang_de.inc.php +++ b/serendipity_event_markdown/UTF-8/lang_de.inc.php @@ -1,6 +1,22 @@ Markdown-Formatierung erlaubt'); +/** + * @version 1.26 + * @author Thomas Hochstein + * EN-Revision: 1.26 + */ +@define('PLUGIN_EVENT_MARKDOWN_NAME', 'Textformatierung: Markdown'); +@define('PLUGIN_EVENT_MARKDOWN_DESC', 'Markdown-Textformatierung durchführen'); +@define('PLUGIN_EVENT_MARKDOWN_EXTRA_NAME', '"Markdown Extra" verwenden'); +@define('PLUGIN_EVENT_MARKDOWN_EXTRA_DESC', 'Markdown Extra iste eine erweiterte Markdown-Variante, vgl. https://michelf.ca/projects/php-markdown/extra/'); +@define('PLUGIN_EVENT_MARKDOWN_TRANSFORM', 'Markdown-Formatierung erlaubt'); + +@define('PLUGIN_EVENT_MARKDOWN_VERSION', 'Markdown-Version'); +@define('PLUGIN_EVENT_MARKDOWN_VERSION_BLABLAH', 'Welche Markdown-Version verwenden? (Siehe https://michelf.ca/projects/php-markdown/ und https://michelf.ca/blog/2013/php-markdown-lib/)'); + +@define('PLUGIN_EVENT_MARKDOWN_SMARTYPANTS_NAME', 'SmartyPants (und Typographer) verwenden'); +@define('PLUGIN_EVENT_MARKDOWN_SMARTYPANTS_DESC', 'SmartyPants (oder SmartyPants Typographer) "verschönern" Text durch Ersetzung bestimmter Zeichen mit passenden HTML-Entities, vgl. https://michelf.ca/projects/php-smartypants/ - Nur mit der "lib"-Version von Markdwon möglich!'); +@define('PLUGIN_EVENT_MARKDOWN_SMARTYPANTS', 'SmartyPants'); +@define('PLUGIN_EVENT_MARKDOWN_SMARTYPANTS_EXTENDED', 'SmartyPants Typographer'); +@define('PLUGIN_EVENT_MARKDOWN_SMARTYPANTS_NEVER', 'deaktiviert'); diff --git a/serendipity_event_markdown/documentation_de.html b/serendipity_event_markdown/documentation_de.html new file mode 100644 index 00000000..1ae85d3f --- /dev/null +++ b/serendipity_event_markdown/documentation_de.html @@ -0,0 +1,195 @@ + + + +Hilfedatei: Markdown + + + +

Textformatierung: Markdown

+ +
+

Inhalt

+
    +
  1. Beschreibung
  2. +
  3. Konfiguration
  4. +
  5. Hinweise
  6. +
+
+ +

Diese Erweiterung stellt die Auszeichnungssprache +Markdown +von John Gruber in der PHP-Variante +("PHP Markdown") +mit der Erweiterung Markdown Extra von Michel Fortin +zur Verfügung.

+ +

Außerdem stehen optional die "Textverschönerer" (prettyfier) +PHP SmartyPants und PHP SmartyPants Typographer +zur Verfügung.

+ +

Beschreibung

+ +

Markdown ist eine Auszeichnungssprache ("Markup") für Web-Autoren, +mit der sich ein einfach lesbarer, leicht zu schreibender Klartext in valides +HTML umsetzen lässt. Der "Rohtext" soll im Gegensatz zu anderen +Auszeichnungssprachen möglichst einfach lesbar sein und "natürlich" +wirken.

+ +

Markdown Extra ist eine Markdown-Erweiterung, die zusätzliche +Funktionen wie Tabellen, Fußnoten und die Definition von Attributen +(ID oder class) zur Verfügung stellt.

+ +

SmartyPants "verschönert" Texte, indem bestimmte einfache Zeichen +durch typographische HTML-Elemente ersetzt werden.

+ +

Mehr dazu:

+ + + +

Konfiguration

+ +

Markdown-Textformatierung aktivieren

+ +

Die Textformatierung kann für folgende Bereiche gesondert aktiviert oder +deaktiviert werden:

+ +
    +
  • Eintrag
  • +
  • Erweiterter Eintrag
  • +
  • Kommentare
  • +
  • HTML-Klotz (wenn serendipity_plugin_html_nugget verwendet wird)
  • +
+ +

Markdown oder Markdown Extra

+ +

Es kann entweder das originale Markdown oder die Erweiterung +Markdown Extra verwendet werden.

+ +

Markdown Extra hat folgende zusätzliche Features:

+ +
    +
  • HTML in Markdown und Markdown in HTML
  • +
  • Attribute wie "id" oder "class" in Markdown
  • +
  • Code-Blocks ohne Einrückung
  • +
  • Tabellen
  • +
  • Fußnoten
  • +
  • Abkürzungen (abbreviations, <abbr></abbr>)
  • +
  • Definitions-Listen (definition lists, <dl></dl>)
  • +
  • nummerierte Listen (<ol></ol>) können mit anderen Zahlen als "1" starten
  • +
+ +

Syntax-Dokumentation:

+ + + +

Die PHP-Markdown-Konfiguration +ist auf die Standardwerte gesetzt und nicht veränderbar. Wenn Sie die +lib-Version verwenden, bekomme Fußnoten jedoch als Prefix die +Nummer des Eintrags in Serendipity (fn_id_prefix).

+ +

Markdown-Version

+ +

Zur Auswahl stehen eine klassische Implementation (classic) oder +die Verwendung der PHP-Markdown-Bibliothek (lib).

+ +

Da die klassische Implementation seit 2013 nicht mehr weiter gepflegt +wird, sollte hier jedenfalls die lib-Version ausgewählt +werden. Nur diese Version unterstützt auch Prefixe für Fußnoten in +Markdown Extra und die Textverschönerung durch SmartyPants oder +SmartyPants Typographer.

+ +

Textformatierung mit SmartyPants und SmartyPants Typographer aktivieren

+ +

SmartyPants und SmartyPants Typographer sind sog. "prettyfier", +die Texte in typographischer Hinsicht "verschönern", indem sie bestimmte +Elemente wie Anführungszeichen in die entsprechenden HTML-Entities verwandeln +oder aus drei Punkten (...) eine "Ellipse" (…) machen.

+ +

Die Aktivierung setzt die Verwendung der lib-Version +von PHP-Markdown voraus!

+ +

Dokumentation: PHP SmartyPants (engl.)

+ +

Hinweise

+ +

CSS für Fußnoten

+ +

Für die Formatierung von Fußnotenzeichen und Fußnoten erzeugt das Plugin folgendes CSS:

+ +
+/* Footnotes (generated by serendipity_event_markdown) */
+
+footnote-ref:after {
+  content: ")";
+}
+
+.footnotes hr {
+  border-top: dashed #ccc;
+  border-width: 1px;
+}
+
+/* mostly taken from http://www.456bereastreet.com/archive/201105/styling_ordered_list_numbers/ */
+.footnotes ol {
+  counter-reset: li;
+  margin-top: .2em;
+  margin-left: 1.5em;
+  padding-left: 0;
+}
+.footnotes ol > li {
+  list-style: none;
+  position: relative;
+  padding-left: .5em;
+  font-size: 90%;
+}
+.footnotes ol > li:before {
+  content: counter(li)")";
+  counter-increment: li;
+  position: absolute;
+  left: -2em;
+  top: -.1em;
+  width: 2em;
+  text-align: right;
+  font-size: 80%;
+  font-weight: bold;
+}
+
+/* --- end of Footnotes */
+
+ + + diff --git a/serendipity_event_markdown/documentation_en.html b/serendipity_event_markdown/documentation_en.html new file mode 100644 index 00000000..35cfa74b --- /dev/null +++ b/serendipity_event_markdown/documentation_en.html @@ -0,0 +1,190 @@ + + + +Documentation: Markdown + + + +

Markup: Markdown

+ +
+

Inhalt

+
    +
  1. Description
  2. +
  3. Configuration
  4. +
  5. Notes
  6. +
+
+ +

This plugin provides the +Markdown +markup language by John Gruber, using the +("PHP Markdown") +port (including the Markdown Extra extension) +by Michel Fortin.

+ +

Additionally it can provide the "prettyfier" +PHP SmartyPants and PHP SmartyPants Typographer.

+ +

Description

+ +

Markdown is a plain text format for writing structured documents, based on +formatting conventions from email and usenet. It allows you to write using an +easy-to-read, easy-to-write plain text format, then convert it to structurally +valid XHTML (or HTML).

+ +

Markdown Extra is an extension to PHP Markdown implementing some +features currently not available with the plain Markdown syntax.

+ +

SmartyPants is a free web typography prettifyier tool for web writers. +It translates plain ASCII punctuation characters into "smart" typographic +punctuation HTML entities.

+ +

Read more:

+ + + +

Configuration

+ +

Activate Markdown parser

+ +

Markdown can be parsed in …

+ +
    +
  • Entry bodies
  • +
  • Extended bodies
  • +
  • Comments
  • +
  • HTML nuggets (using serendipity_plugin_html_nugget)
  • +
+ +

Markdown or Markdown Extra

+ +

You can choose from the traditional Markdown and +Markdown Extra flavours.

+ +

Markdown Extra offers some additional features:

+ +
    +
  • HTML in Markdown and Markdown in HTML
  • +
  • attributes like "id" or "class" in Markdown
  • +
  • fenced code blocks without intendation
  • +
  • tables
  • +
  • footnotes
  • +
  • Abbreviations (<abbr></abbr>)
  • +
  • definition lists (<dl></dl>)
  • +
  • ordered lists (<ol></ol>) can start with another value than "1"
  • +
+ +

Syntax:

+ + + +

All PHP-Markdown configuration +options are set to their default values and can't be changed, with one +exception: using the lib version, footnotes will get the +Serendipity entry id set as prefix (fn_id_prefix).

+ +

Markdown version

+ +

You can choose from the classic or lib (library +package) version.

+ +

As the classic version of PHP Markdown and +PHP Markdown Extra is no longer being supported since February 1, 2013, +you should choose the lib version in any case. +Furthermore, the classic version doesn't support +SmartyPants or footnote prefixes.

+ +

Aktivate SmartyPants or SmartyPants Typographer parser

+ +

SmartyPants and SmartyPants Typographer translate plain ASCII +punctuation characters into "smart" typographic punctuation HTML entities.

+ +

You have to choose the lib version of +PHP-Markdown to activate SmartyPants!

+ +

Documentation: PHP SmartyPants

+ +

Notes

+ +

CSS for footnotes

+ +

The plugin will add some CSS to style footnotes and footnote markers:

+ +
+/* Footnotes (generated by serendipity_event_markdown) */
+
+footnote-ref:after {
+  content: ")";
+}
+
+.footnotes hr {
+  border-top: dashed #ccc;
+  border-width: 1px;
+}
+
+/* mostly taken from http://www.456bereastreet.com/archive/201105/styling_ordered_list_numbers/ */
+.footnotes ol {
+  counter-reset: li;
+  margin-top: .2em;
+  margin-left: 1.5em;
+  padding-left: 0;
+}
+.footnotes ol > li {
+  list-style: none;
+  position: relative;
+  padding-left: .5em;
+  font-size: 90%;
+}
+.footnotes ol > li:before {
+  content: counter(li)")";
+  counter-increment: li;
+  position: absolute;
+  left: -2em;
+  top: -.1em;
+  width: 2em;
+  text-align: right;
+  font-size: 80%;
+  font-weight: bold;
+}
+
+/* --- end of Footnotes */
+
+ + + diff --git a/serendipity_event_markdown/lang_de.inc.php b/serendipity_event_markdown/lang_de.inc.php index 33e84316..b85823bc 100644 --- a/serendipity_event_markdown/lang_de.inc.php +++ b/serendipity_event_markdown/lang_de.inc.php @@ -1,6 +1,22 @@ Markdown-Formatierung erlaubt'); +/** + * @version 1.26 + * @author Thomas Hochstein + * EN-Revision: 1.26 + */ +@define('PLUGIN_EVENT_MARKDOWN_NAME', 'Textformatierung: Markdown'); +@define('PLUGIN_EVENT_MARKDOWN_DESC', 'Markdown-Textformatierung durchführen'); +@define('PLUGIN_EVENT_MARKDOWN_EXTRA_NAME', '"Markdown Extra" verwenden'); +@define('PLUGIN_EVENT_MARKDOWN_EXTRA_DESC', 'Markdown Extra iste eine erweiterte Markdown-Variante, vgl. https://michelf.ca/projects/php-markdown/extra/'); +@define('PLUGIN_EVENT_MARKDOWN_TRANSFORM', 'Markdown-Formatierung erlaubt'); + +@define('PLUGIN_EVENT_MARKDOWN_VERSION', 'Markdown-Version'); +@define('PLUGIN_EVENT_MARKDOWN_VERSION_BLABLAH', 'Welche Markdown-Version verwenden? (Siehe https://michelf.ca/projects/php-markdown/ und https://michelf.ca/blog/2013/php-markdown-lib/)'); + +@define('PLUGIN_EVENT_MARKDOWN_SMARTYPANTS_NAME', 'SmartyPants (und Typographer) verwenden'); +@define('PLUGIN_EVENT_MARKDOWN_SMARTYPANTS_DESC', 'SmartyPants (oder SmartyPants Typographer) "verschönern" Text durch Ersetzung bestimmter Zeichen mit passenden HTML-Entities, vgl. https://michelf.ca/projects/php-smartypants/ - Nur mit der "lib"-Version von Markdwon möglich!'); +@define('PLUGIN_EVENT_MARKDOWN_SMARTYPANTS', 'SmartyPants'); +@define('PLUGIN_EVENT_MARKDOWN_SMARTYPANTS_EXTENDED', 'SmartyPants Typographer'); +@define('PLUGIN_EVENT_MARKDOWN_SMARTYPANTS_NEVER', 'deaktiviert'); diff --git a/serendipity_event_markdown/lang_en.inc.php b/serendipity_event_markdown/lang_en.inc.php index fbebd94c..e9d90ea9 100644 --- a/serendipity_event_markdown/lang_en.inc.php +++ b/serendipity_event_markdown/lang_en.inc.php @@ -9,14 +9,15 @@ @define('PLUGIN_EVENT_MARKDOWN_NAME', 'Markup: Markdown'); @define('PLUGIN_EVENT_MARKDOWN_DESC', 'Apply Markdown markup to entry text'); @define('PLUGIN_EVENT_MARKDOWN_EXTRA_NAME', 'Markup: Markdown Extra'); -@define('PLUGIN_EVENT_MARKDOWN_EXTRA_DESC', 'Apply Markdown Extra markup to entry text (See: http://michelf.ca/projects/php-markdown/extra/)'); -@define('PLUGIN_EVENT_MARKDOWN_TRANSFORM', 'Markdown format allowed'); +@define('PLUGIN_EVENT_MARKDOWN_EXTRA_DESC', 'Apply Markdown Extra markup to entry text (See: https://michelf.ca/projects/php-markdown/extra/)'); +@define('PLUGIN_EVENT_MARKDOWN_TRANSFORM', 'Markdown format allowed'); @define('PLUGIN_EVENT_MARKDOWN_VERSION', 'Markdown Version'); -@define('PLUGIN_EVENT_MARKDOWN_VERSION_BLABLAH', 'Which version of Markdown do you want to use? (http://michelf.ca/projects/php-markdown/ and http://michelf.ca/blog/2013/php-markdown-lib/)'); +@define('PLUGIN_EVENT_MARKDOWN_VERSION_BLABLAH', 'Which version of Markdown do you want to use? (https://michelf.ca/projects/php-markdown/ and https://michelf.ca/blog/2013/php-markdown-lib/)'); @define('PLUGIN_EVENT_MARKDOWN_SMARTYPANTS_NAME', 'Markup: SmartyPants'); -@define('PLUGIN_EVENT_MARKDOWN_SMARTYPANTS_DESC', 'Apply SmartyPants (+Typographer) markup to entry text (See: http://michelf.ca/projects/php-smartypants/). Use with lib only!'); -@define('PLUGIN_EVENT_MARKDOWN_SMARTYPANTS_EXTENDED', '+Typographer'); -@define('PLUGIN_EVENT_MARKDOWN_SMARTYPANTS_NEVER', 'Disabled'); +@define('PLUGIN_EVENT_MARKDOWN_SMARTYPANTS_DESC', 'Apply SmartyPants (+Typographer) markup to entry text (See: https://michelf.ca/projects/php-smartypants/). Use with lib only!'); +@define('PLUGIN_EVENT_MARKDOWN_SMARTYPANTS', 'SmartyPants'); +@define('PLUGIN_EVENT_MARKDOWN_SMARTYPANTS_EXTENDED', 'SmartyPants Typographer'); +@define('PLUGIN_EVENT_MARKDOWN_SMARTYPANTS_NEVER', 'none'); diff --git a/serendipity_event_markdown/serendipity_event_markdown.php b/serendipity_event_markdown/serendipity_event_markdown.php index 3deae95b..3ebd538b 100644 --- a/serendipity_event_markdown/serendipity_event_markdown.php +++ b/serendipity_event_markdown/serendipity_event_markdown.php @@ -31,7 +31,7 @@ class serendipity_event_markdown extends serendipity_event 'smarty' => '2.6.7', 'php' => '5.3.0' )); - $propbag->add('version', '1.25'); + $propbag->add('version', '1.26'); $propbag->add('cachable_events', array('frontend_display' => true)); $propbag->add('event_hooks', array( 'frontend_display' => true, @@ -112,7 +112,7 @@ class serendipity_event_markdown extends serendipity_event $propbag->add('description', PLUGIN_EVENT_MARKDOWN_SMARTYPANTS_DESC); $propbag->add('radio', array( 'value' => array(1, 2, 0), - 'desc' => array(YES, PLUGIN_EVENT_MARKDOWN_SMARTYPANTS_EXTENDED, PLUGIN_EVENT_MARKDOWN_SMARTYPANTS_NEVER) + 'desc' => array(PLUGIN_EVENT_MARKDOWN_SMARTYPANTS, PLUGIN_EVENT_MARKDOWN_SMARTYPANTS_EXTENDED, PLUGIN_EVENT_MARKDOWN_SMARTYPANTS_NEVER) )); $propbag->add('default', 0); return true;