From cfd0246b241cb6e58153e68f7e30ed56b9bf054b Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sun, 17 Nov 2024 20:15:02 -0300 Subject: Remove jekyll infrastructure setup --- ...8-13-anchor-headers-and-code-lines-in-jekyll.po | 187 --------------------- 1 file changed, 187 deletions(-) delete mode 100644 po/fr/LC_MESSAGES/_tils/2020-08-13-anchor-headers-and-code-lines-in-jekyll.po (limited to 'po/fr/LC_MESSAGES/_tils/2020-08-13-anchor-headers-and-code-lines-in-jekyll.po') diff --git a/po/fr/LC_MESSAGES/_tils/2020-08-13-anchor-headers-and-code-lines-in-jekyll.po b/po/fr/LC_MESSAGES/_tils/2020-08-13-anchor-headers-and-code-lines-in-jekyll.po deleted file mode 100644 index a11e17c..0000000 --- a/po/fr/LC_MESSAGES/_tils/2020-08-13-anchor-headers-and-code-lines-in-jekyll.po +++ /dev/null @@ -1,187 +0,0 @@ -# -msgid "" -msgstr "" - -msgid "" -"title: Anchor headers and code lines in Jekyll\n" -"date: 2020-08-13\n" -"layout: post\n" -"lang: en\n" -"ref: anchor-headers-and-code-lines-in-jekyll" -msgstr "" - -msgid "" -"The default Jekyll toolbox ([Jekyll](https://jekyllrb.com/), " -"[kramdown](https://kramdown.gettalong.org/) and " -"[rouge](http://rouge.jneen.net/)) doesn't provide with a configuration " -"option to add anchors to headers and code blocks." -msgstr "" - -msgid "" -"The best way I found of doing this is by creating a simple Jekyll plugin, " -"more specifically, a [Jekyll " -"hook](https://jekyllrb.com/docs/plugins/hooks/). These allow you to jump in " -"to the Jekyll build and add a processing stage before of after Jekyll " -"performs something." -msgstr "" - -msgid "" -"All you have to do is add the code to `_plugins/my-jekyll-plugin-code.rb`, " -"and Jekyll knows to pick it up and call your code on the appropriate time." -msgstr "" - -msgid "Anchor on headers" -msgstr "" - -msgid "" -"Since I wanted to add anchors to headers in all documents, this Jekyll hook " -"works on `:documents` after they have been transformed into HTML, the " -"`:post_render` phase:" -msgstr "" - -msgid "" -"I've derived my implementations from two \"official\"[^official] hooks, " -"[jemoji](https://github.com/jekyll/jemoji) and [jekyll-" -"mentions](https://github.com/jekyll/jekyll-mentions)." -msgstr "" - -msgid "" -"[^official]: I don't know how official they are, I just assumed it because " -"they live in the same organization inside GitHub that Jekyll does." -msgstr "" - -msgid "" -"All I did was to wrap the header tag inside an ``, and set the `href` of " -"that `` to the existing id of the header. Before the hook the HTML looks " -"like:" -msgstr "" - -msgid "And after the hook should turn that into:" -msgstr "" - -msgid "" -"The used regexp tries to match only h1-h6 tags, and keep the rest of the " -"HTML attributes untouched, since this isn't a general HTML parser, but the " -"generated HTML is somewhat under your control. Use at your own risk because " -"[you shouldn't parse HTML with " -"regexps](https://stackoverflow.com/questions/1732348/regex-match-open-tags-" -"except-xhtml-self-contained-tags/1732454#1732454). Also I used this strategy" -" in my environment, where no other plugins are installed. I haven't " -"considered how this approach may conflict with other Jekyll plugins." -msgstr "" - -msgid "" -"In the new anchor tag you can add your custom CSS class to style it as you " -"wish." -msgstr "" - -msgid "Anchor on code blocks" -msgstr "" - -msgid "" -"Adding anchors to code blocks needs a little bit of extra work, because line" -" numbers themselves don't have preexisting ids, so we need to generate them " -"without duplications between multiple code blocks in the same page." -msgstr "" - -msgid "" -"Similarly, this Jekyll hook also works on `:documents` in the `:post_render`" -" phase:" -msgstr "" - -msgid "" -"This solution assumes the default Jekyll toolbox with code line numbers " -"turned on in `_config.yml`:" -msgstr "" - -msgid "" -"The anchors go from B1-L1 to BN-LN, using the `code_block_counter` to track " -"which code block we're in and don't duplicate anchor ids. Before the hook " -"the HTML looks like:" -msgstr "" - -msgid "Happy writing :)" -msgstr "" - -msgid "" -"Jekyll::Hooks.register :documents, :post_render do |doc|\n" -" if doc.output_ext == \".html\"\n" -" doc.output =\n" -" doc.output.gsub(\n" -" /(.*?)<\\/h[1-6]>/,\n" -" '\\5'\n" -" )\n" -" end\n" -"end\n" -msgstr "" - -msgid "" -"...some unmodified text...\n" -"

\n" -" My header\n" -"

\n" -"...more unmodified text...\n" -msgstr "" - -msgid "" -"...some unmodified text...\n" -"\n" -"

\n" -" My header\n" -"

\n" -"
\n" -"...more unmodified text...\n" -msgstr "" - -msgid "" -"PREFIX = '
'\n"
-"POSTFIX = '
'\n" -"Jekyll::Hooks.register :documents, :post_render do |doc|\n" -" if doc.output_ext == \".html\"\n" -" code_block_counter = 1\n" -" doc.output = doc.output.gsub(/
[\\n0-9]+<\\/pre>/) do |match|\n"
-"      line_numbers = match\n"
-"                      .gsub(/
([\\n0-9]+)<\\/pre>/, '\\1')\n"
-"                      .split(\"\\n\")\n"
-"\n"
-"      anchored_line_numbers_array = line_numbers.map do |n|\n"
-"        id = \"B#{code_block_counter}-L#{n}\"\n"
-"        \"#{n}\"\n"
-"      end\n"
-"      code_block_counter += 1\n"
-"\n"
-"      PREFIX + anchored_line_numbers_array.join(\"\\n\") + POSTFIX\n"
-"    end\n"
-"  end\n"
-"end\n"
-msgstr ""
-
-msgid ""
-"kramdown:\n"
-"  syntax_highlighter_opts:\n"
-"    span:\n"
-"      line_numbers: false\n"
-"    block:\n"
-"      line_numbers: true\n"
-msgstr ""
-
-msgid ""
-"...some unmodified text...\n"
-"
1\n"
-"2\n"
-"3\n"
-"4\n"
-"5\n"
-"
\n" -"...more unmodified text...\n" -msgstr "" - -msgid "" -"...some unmodified text...\n" -"
1\n"
-"2\n"
-"3\n"
-"4\n"
-"5
\n" -"...more unmodified text...\n" -msgstr "" -- cgit v1.2.3