From: Vladimír Vondruš Date: Mon, 11 Dec 2017 01:22:53 +0000 (+0100) Subject: m.code: initial test. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=1327a7e67dbccfd04ae55bb172ab04d43364303e;p=blog.git m.code: initial test. --- diff --git a/pelican-plugins/m/test/code/console.ansi b/pelican-plugins/m/test/code/console.ansi new file mode 120000 index 00000000..003cf1e9 --- /dev/null +++ b/pelican-plugins/m/test/code/console.ansi @@ -0,0 +1 @@ +../../../../doc/plugins/math-and-code-console.ansi \ No newline at end of file diff --git a/pelican-plugins/m/test/code/page.html b/pelican-plugins/m/test/code/page.html new file mode 100644 index 00000000..e437108b --- /dev/null +++ b/pelican-plugins/m/test/code/page.html @@ -0,0 +1,51 @@ + + + + + m.code | A Pelican Blog + + + + + + + + + + + + + +
+
+
+
+
+
+

m.code

+ +
int main() {
+    return 0;
+}
+
int main() {
+    return 1;
+}
+

Inline code is here: constexpr

+
![mosra@don-perverzo m.css]$ ls
+CONTRIBUTING.rst  CREDITS.rst  doc      pelican-plugins  README.rst
+COPYING           css          doxygen  pelican-theme    site
+
// this language is not highlighted
+ +
+
+
+
+
+ + diff --git a/pelican-plugins/m/test/code/page.rst b/pelican-plugins/m/test/code/page.rst new file mode 100644 index 00000000..8aed59c6 --- /dev/null +++ b/pelican-plugins/m/test/code/page.rst @@ -0,0 +1,30 @@ +m.code +###### + +:summary: no. + +.. role:: cpp(code) + :language: c++ + +.. code:: c++ + + int main() { + return 0; + } + +.. code:: c++ + :class: m-inverted + :hl_lines: 2 + + int main() { + return 1; + } + +Inline code is here: :cpp:`constexpr` + +.. include:: console.ansi + :code: ansi + +.. code:: whatthefuck + + // this language is not highlighted diff --git a/pelican-plugins/m/test/test_code.py b/pelican-plugins/m/test/test_code.py new file mode 100644 index 00000000..15deccd7 --- /dev/null +++ b/pelican-plugins/m/test/test_code.py @@ -0,0 +1,12 @@ +from m.test import PluginTestCase + +class Abbr(PluginTestCase): + def __init__(self, *args, **kwargs): + super().__init__(__file__, '', *args, **kwargs) + + def test(self): + self.run_pelican({ + 'PLUGINS': ['m.htmlsanity', 'm.code'] + }) + + self.assertEqual(*self.actual_expected_contents('page.html'))