Coder Social home page Coder Social logo

mosra / m.css Goto Github PK

View Code? Open in Web Editor NEW
395.0 20.0 87.0 4.37 MB

A no-nonsense, no-JavaScript CSS framework, site and documentation theme for content-oriented websites

Home Page: https://mcss.mosra.cz

License: MIT License

CSS 26.69% Python 65.64% HTML 7.57% Shell 0.09% C++ 0.01%
css html5 pelican python webdesign restructuredtext static-site-generator pelican-theme pelican-plugins doxygen

m.css's Introduction

m.css

A no-nonsense, no-JavaScript CSS framework, site and documentation theme for content-oriented websites

Join the chat at https://gitter.im/mosra/m.css

image

image

MIT License

Do you hate contemporary web development like I do? Do you also feel that it's not right for a web page to take seconds and megabytes to render? Do you want to write beautiful content but can't because the usual CMS tools make your blood boil and so you rather stay silent? Well, I have something for you.

Project website: https://mcss.mosra.cz

Pure CSS and HTML

Everything you need is a few kilobytes of compressed CSS. This framework has exactly 0 bytes of JavaScript because nobody actually needs it. Even for responsive websites.

Get the CSS

Designed for content

If you just want to write content with beautiful typography, you don't need forms, progressbars, popups, dropdowns or other cruft. You want fast iteration times.

Use it with Pelican

Authoring made easy

Code snippets, math, linking to docs, presenting photography in a beautiful way? Or making a complex page without even needing to touch HTML? Everything is possible.

Get Pelican plugins


Still not convinced? Head over to a detailed explanation of this project goals and design decisions.

CONTRIBUTING

Head over to the contribution guide to see how to make changes, verify the results and submit patches.

CONTACT

Want to learn more about m.css? Found a bug or want to share an awesome idea? Feel free to visit the project website or contact the author at:

CREDITS

See the CREDITS.rst file for details about contributors and third-party code involved in this project. Big thanks to everyone involved!

LICENSE

m.css is licensed under MIT/Expat license, see COPYING file for details.

m.css's People

Contributors

andydecleyre avatar blairconrad avatar bridouz avatar cbritopacheco avatar crisluengo avatar darkcontact avatar ecstrema avatar gitter-badger avatar gotchafr avatar hazelnusse avatar jelmer avatar joshyrobot avatar leandros avatar lpirl avatar luzpaz avatar marinjurjevic avatar marzer avatar mosra avatar paulignari avatar shniubobo avatar sizmailov avatar typesanitizer avatar williamjcm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

m.css's Issues

HTML for multiple pages inside one source file seems to have wrong names, or wrong links

In doxygen it seems to be permitted to write code like this:

/*!
\mainpage Welcome
 - \subpage Test
*/

/*!
\page Test Title
*/

where two pages can be defined inside the one source file. This generates two html files, index.html and _test.html. However, when your script does it, it generates index.html and Test.html. This would be fine I guess, except that the link generated by "\subpage Test" is still to the page "_test.html", which doesn't exist, so the link doesn't work. So I guess you need to either change how the links are generated, or how these "extra" pages are named :).

AssertionError parsing indexpage.xml, related to addition of mainpage?

So now I am trying to add some extra pages to the documentation. For example I tried adding a \mainpage with this content:

/*!
 \mainpage The Main Page
 \section sec_1 Section 1
 ...section 1 stuff...
 \section sec_2 Section 2
 ... section 2 stuff...
*/

However the dox2html5.py script falls over when parsing indexpage.xml like this:

DEBUG:root:Parsing indexpage.xml
Traceback (most recent call last):
  File "/home/farmer/repos/gambit/myfork/m.css/doxygen/dox2html5.py", line 2895, in <module>
    run(doxyfile, os.path.abspath(args.templates), args.wildcard, args.index_pages, search_merge_subtrees=not args.search_no_subtree_merging, search_add_lookahead_barriers=not args.search_no_lookahead_barriers, search_merge_prefixes=not args.search_no_prefix_merging)
  File "/home/farmer/repos/gambit/myfork/m.css/doxygen/dox2html5.py", line 2813, in run
    parsed = parse_xml(state, file)
  File "/home/farmer/repos/gambit/myfork/m.css/doxygen/dox2html5.py", line 1938, in parse_xml
    compound.description, templates, compound.sections, footer_navigation, example_navigation, search_keywords, compound.is_deprecated = parse_toplevel_desc(state, compounddef.find('detaileddescription'))
  File "/home/farmer/repos/gambit/myfork/m.css/doxygen/dox2html5.py", line 1316, in parse_toplevel_desc
    parsed = parse_desc_internal(state, element)
  File "/home/farmer/repos/gambit/myfork/m.css/doxygen/dox2html5.py", line 651, in parse_desc_internal
    parsed = parse_desc_internal(state, i)
  File "/home/farmer/repos/gambit/myfork/m.css/doxygen/dox2html5.py", line 677, in parse_desc_internal
    id = extract_id_hash(state, element)
  File "/home/farmer/repos/gambit/myfork/m.css/doxygen/dox2html5.py", line 415, in extract_id_hash
    assert base_url == state.current_url
AssertionError

Raw doxygen seems to have no problem with it:

doxygen

I looked in indexpage.xml, it doesn't look that weird to me, but perhaps you will see something :). I have attached both the full output and indexpage.xml (renamed to indexpage_xml.txt to make github happy). This is the same project as my last issue report so you can find everything at https://github.com/bjfar/gambit_1.1/tree/docs_pelican, in the 'doc' directory.

mcss_out.txt
indexpage_xml.txt

Pages not generating TOC

Even though I specify that a TOC should appear on the page, none is actually in the final html output:

screen shot 2018-02-08 at 19 23 52

And aside from that, I got a quick question: How did you managed to setup the Pages page in the Magnum docs? Even though I almost exactly copied your setup in Magnum, by creating a 00-page-order.dox and putting all my pages in there, they still appear without brief on the Pages page. And similar for the fancy dropdown list under pages?

[ImageGrid] 'PngImageFile' object has no attribute '_getexif'

Your ImageGrid function is really nice but it does not work with png files.

PNG files does not support exif data.

Thus what could be done with the plugin if the images are screenshots ? Screenshots do not have exposure, iso and stuffs so the plugin fails with that too.

Maybe images.py could include an alternative where specific exif data are not found like only displaying the filename.

declare file encoding

In my environment (debian 9, pelican 3.7.1 from debian package), pelican content complains about Non-ASCII character '\xc2' in file, due UTF8 characters in copyright statement.

Prepending a charset declaration to python files let's thing woks for all files except for htmlsanity.py, so I made pull request #15 with my patch.

The file htmlsanity.py has another trouble with python 2.7:

CRITICAL: TypeError: ord() expected a character, but string of length 6 found

due this line:

ord('\u00AD'): '&shy;'}

but I don't know how to deal with it.

Include functions inside file pages

Currently, the pages for files do not include freestanding functions declared inside the functions. Only namespaces or classes are shown.
Vanilla doxygen does, though. The XML does not list functions inside the files .xml, only namespaces. Though, by looking up the namespace one can get the functions, since they contain where they're declared.

Edit: This only seems to be the case, when they're not in the global namespace.

Bring Pyphen hyphenation to the Doxygen theme as well

Opening an issue to avoid forgetting about this, as I don't have time to look into it right now.

What needs to be done:

  • Intercept various places where HTML code is produced and call Pyphen in there (may be quite ugly, best would be to reuse the docutils document tree but that's much much more work)
  • Avoid calling Pyphen in problematic cases (inline code, code blocks, links where link title is an URL, math blocks, function parameter names, ...), try to match the behavior with the corresponding Pelican plugin (is it done for headings? or just for copy?)
  • Getting the hyphenation language from Doxyfile setting (is there any way to specify language per-file or per-paragraph as in reST? I assume not)
  • Ability to control the hyphenation globally (M_HYPHENATION, maybe?)
  • Ability to control the hyphenation per-paragraph (some @m_hyphenate{lang|off} command, maybe?)

Cc: @jbakosi

Fix compatibility with Jinja2 2.10

The template output has some extra blank lines when processed with Jinja2 2.10. It was all coded against 2.9 and probably some 2.9-specific workarounds there are to blame. Things to do:

  • pin to 2.9.6 locally and on the CI until I find time to fix this
  • fix this, remove what's not needed anymore (and add new workarounds needed now? hopefully not)
  • use latest jinja2 in the CI setup

Make it possible to hide away parts of code in compiled snippets / symbol definitions

cppreference.com has some definitions marked as /* implementation defined */ (for example NAN). An equivalent functionality would be useful to have here:

  • to hide away complex type definitions or default template parameters (especially when type traits and SFINAE is involved), yet still notify the user that there's some such parameter/definition instead of hiding it away completely
  • to have code snippets compilable (verifying their validity) but still succint enough (e.g. hiding away variable initializers, function definitions that the compiler requires, ...)

I think this could be done with a set of macros:

  • MCSS_ELLIPSIS(...) / MCSS_IGNORE(...), in code snippets, would again compile to __VA_ARGS__, but will be replaced with the Unicode ellipsis character / noting when doing code highlighting for the docs (again, with a distinct color) -- possible to implement on user side since 0c5ba9a (and used this way in magnum, see #188 (comment) for details), not a builtin feature since the snippet files themselves would need to #define that for the compiler
    • figure out a way how to make this builtin (provide a header with such definitions so the user can just #include <mcss.h>? feels a bit too tied to the doc generator), or maybe just document that the user has to #define these and then the tool will directly recognize this? or maybe provide a way to tell the tool which macro is an ellipsis and which an ignore instead
  • MCSS_IMPLEMENTATION_DEFINED(...), in symbol definitions, would normally compile to __VA_ARGS__, but will be replaced with an /* implementation defined */ comment when generating docs (and the comment would be possibly styled differently from other comments -- red color?
    • same as above, provide a way to tell the tool which (user-defined) macro name should be treated like this
  • This would be useful for the m.code Pelican plugin as well, in case the code is used both in an article and as a source for an executable. -- done in a246040

Class inheritance causes errors in dox2html5.py

Using this code:

// Player.h
/**
* @brief Player class
*/
class Player: public Actor {
    ...
}

// Actor.h
/**
* @brief Actor class
*/
class Actor {
    ...
}

I get this error:

DEBUG:root:Parsing class_actor.xml
Traceback (most recent call last):
  File "dox2html5.py", line 2936, in <module>
    run(doxyfile, os.path.abspath(args.templates), args.wildcard, args.index_pages, search_merge_subtrees=not args.search_no_subtree_merging, search_add_lookahead_barriers=not args.search_no_lookahead_barriers, search_merge_prefixes=not args.search_no_prefix_merging)
  File "dox2html5.py", line 2854, in run
    parsed = parse_xml(state, file)
  File "dox2html5.py", line 2165, in parse_xml
    class_.name = symbol.leaf_name if symbol.parent.startswith(state.compounds[compound.id].parent) else symbol.name
AttributeError: 'NoneType' object has no attribute 'startswith'

It only happens when both Actor and Player are documented... My only guess is it has to do with the class inheritance.

Is \ingroup not supported?

I am facing troubles:

INFO:root:group__fire__and__forget__orders__group_1details_send_fire_and_forget_order_with_quote_and_side
Traceback (most recent call last):
  File "/home/dhanjit.d/dump/m.css/doxygen/dox2html5.py", line 3027, in <module>
    run(doxyfile, os.path.abspath(args.templates), args.wildcard, args.index_pages, search_merge_subtrees=not args.search_no_subtree_merging, search_add_lookahead_barriers=not args.search_no_lookahead_barriers, search_merge_prefixes=not args.search_no_prefix_merging)
  File "/home/dhanjit.d/dump/m.css/doxygen/dox2html5.py", line 2941, in run
    parsed = parse_xml(state, file)
  File "/home/dhanjit.d/dump/m.css/doxygen/dox2html5.py", line 2318, in parse_xml
    func = parse_func(state, memberdef)
  File "/home/dhanjit.d/dump/m.css/doxygen/dox2html5.py", line 1581, in parse_func
    func.description, templates, params, func.return_value, func.return_values, func.exceptions, search_keywords, func.is_deprecated = parse_func_desc(state, element)
  File "/home/dhanjit.d/dump/m.css/doxygen/dox2html5.py", line 1428, in parse_func_desc
    parsed = parse_desc_internal(state, element.find('detaileddescription'))
  File "/home/dhanjit.d/dump/m.css/doxygen/dox2html5.py", line 777, in parse_desc_internal
    add_css_class=add_css_class)
  File "/home/dhanjit.d/dump/m.css/doxygen/dox2html5.py", line 1237, in parse_desc_internal
    out.parsed += '<a name="{}"></a>'.format(extract_id_hash(state, i))
  File "/home/dhanjit.d/dump/m.css/doxygen/dox2html5.py", line 424, in extract_id_hash
    assert id.startswith(state.current_compound.url_base)
AssertionError
python3.6 ~/dump/m.css/doxygen/dox2html5.py Doxyfile-mcss --debug  111.52s user 3.01s system 99% cpu 1:54.63 total

CSS Grids

There seems to have been a native implementation of grids in CSS for a while now.

The CONTRIBUTING-file referenced, that all files need to be used [might be including m-grid.css].
Would implementing native grids significantly enhance loading time if implemented?

generating smaller copies of images

It would be great if there was a way to automatically generate smaller photos for use in e.g. image grids.

When including high-resolution images, a page with an image grid with a dozen photos can become quite bulky (and slow to load over some connections).

CRITICAL: SyntaxError: Non-ASCII character (fix)

Hello,
first, I love the idea of the theme, we really need more lightweight, content oriented stuff. Good job, thanks!

EDIT: the real, very real origin of this bug is that I had pelican from python 2.7, not python3 (as pip installed that as default). The error doesn't rise after removing pelican and reinstalling it from pip3. I apologise.

Now, for the issue.

A fresh pelican-quickstart and the mcss repo cloned, so nothing missing (Pelican: 3.7.1)

:$ pelican content
CRITICAL: SyntaxError: Non-ASCII character '\xc2' in file /home/user/arteteco-mcss/m.css/pelican-plugins/m/__init__.py on line 4, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (__init__.py, line 4)

I solved it by adding the coding to the beginning of the file. This should be in theory done with all files, I guess?

# -*- coding: utf-8 -*-

Afterwards I had different error trying to generate the website, I'll paste it here but maybe is better to open another issue for it?

CRITICAL: TypeError: ord() expected a character, but string of length 6 found

Doxygen Theme AssertionError parsing class xml

Similar to the error that shows up in #33 except using the default doxygen config does not solve the issue. As far as I can tell, there's something unexpected in the xml but I can't determine what it is.

DEBUG:root:Parsing classmodel_1_1Model.xml
WARNING:root:classmodel_1_1Model.xml: no filename attribute in <programlisting>, assuming C++
WARNING:root:classmodel_1_1Model.xml: inline code has multiple lines, fallback to a code block
WARNING:root:classmodel_1_1Model.xml: no filename attribute in <programlisting>, assuming C++
WARNING:root:classmodel_1_1Model.xml: inline code has multiple lines, fallback to a code block
WARNING:root:classmodel_1_1Model.xml: no filename attribute in <programlisting>, assuming C++
WARNING:root:classmodel_1_1Model.xml: no filename attribute in <programlisting>, assuming C++
WARNING:root:classmodel_1_1Model.xml: inline code has multiple lines, fallback to a code block
WARNING:root:classmodel_1_1Model.xml: no filename attribute in <programlisting>, assuming C++
Traceback (most recent call last):
  File "./mcss/doxygen/dox2html5.py", line 2948, in <module>
    run(doxyfile, os.path.abspath(args.templates), args.wildcard, args.index_pages, search_merge_subtrees=not args.search_no_subtree_merging, search_add_lookahead_barriers=not args.search_no_lookahead_barriers, search_merge_prefixes=not args.search_no_prefix_merging)
  File "./mcss/doxygen/dox2html5.py", line 2866, in run
    parsed = parse_xml(state, file)
  File "./mcss/doxygen/dox2html5.py", line 2254, in parse_xml
    func = parse_func(state, memberdef)
  File "./mcss/doxygen/dox2html5.py", line 1517, in parse_func
    func.description, templates, params, func.return_value, func.return_values, func.exceptions, search_keywords, func.is_deprecated = parse_func_desc(state, element)
  File "./mcss/doxygen/dox2html5.py", line 1364, in parse_func_desc
    parsed = parse_desc_internal(state, element.find('detaileddescription'))
  File "./mcss/doxygen/dox2html5.py", line 659, in parse_desc_internal
    assert not parsed.templates and not parsed.params and not parsed.return_value
AssertionError

Gist of the xml: https://gist.github.com/glfmn/eeebe1237920d5f81c92af5194c045de

MacOS and the Math Plug In

On MacOS, even after installing a LaTeX distribution, the latex2svg.py utility may not work until you've edited your $PATH. If you have MacTex installed (either via Homebrew or some other means), this solution on stackexchange worked for me.

Remove paragraph indent after code block

To get a nicely formatted code block, it seems the Doxygen thing to do is:

Some text

\code
My code here
\endcode

Some more text

Which works fine, however m.css seems to indent the following text paragraph without exception. I tried removing the newline between the code block and test, but this just puts the text inline with the code block.

Grammatically there are often cases where a code block forms part of a paragraph, even a sentence, so starting a new paragraph after one doesn't always make sense. I guess in standard Doxygen this doesn't come up as a problem since they don't use indenting for paragraphs, but with indented paragraphs the distinction becomes visible.

Do you know any way around this?

Smart quotes without .. class:: reST directive

Hi,

I've been playing with m.css for a few days and I have a question about your smart quotes implementation.

From what I understand here I can have french-style quotes rendered on Pelican.

But for that I must type .. class:: language-fr on my reST post.

Your doc says :

The de­fault lan­guage is of course tak­en from the stan­dard DEFAULT_LANG op­tion, which de­faults to 'en'.

My DEFAULT_LANG is fr so I assume that every curles would be frensh-styled. But they are not.

Am I misunderstanding the doc ?

Thanks

No styling generated

Hello there,

I've followed the instructions in http://mcss.mosra.cz/doxygen/#troubleshooting but the generated html files have no styling whatsoever. The compilation finishes with the following message:

Traceback (most recent call last):
  File "./dox2html5.py", line 3041, in <module>
    run(doxyfile, os.path.abspath(args.templates), args.wildcard, args.index_pages, search_merge_subtrees=not args.search_no_subtree_merging, search_add_lookahead_barriers=not args.search_no_lookahead_barriers, search_merge_prefixes=not args.search_no_prefix_merging)
  File "./dox2html5.py", line 2955, in run
    parsed = parse_xml(state, file)
  File "./dox2html5.py", line 2060, in parse_xml
    compound.description, templates, compound.sections, footer_navigation, example_navigation, search_keywords, compound.is_deprecated = parse_toplevel_desc(state, compounddef.find('detaileddescription'))
  File "./dox2html5.py", line 1415, in parse_toplevel_desc
    parsed = parse_desc_internal(state, element)
  File "./dox2html5.py", line 784, in parse_desc_internal
    add_css_class=add_css_class)
  File "./dox2html5.py", line 765, in parse_desc_internal
    out.parsed += '<{0}>{1}</{0}>'.format(tag, html.escape(i.text))
  File "/usr/local/Cellar/python/3.6.4_3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/html/__init__.py", line 19, in escape
    s = s.replace("&", "&amp;") # Must be done first!
AttributeError: 'NoneType' object has no attribute 'replace'

Can anyone give me a hand? Thanks!
I'm using MacOS
Python 3.6.4
Doxygen 1.8.14

Doxygen: Extra <p><br /> added when a node contains multiple \remarks, \warning, etc.

See title. Essentially, this:

/// \brief	...
/// \remarks	Some noteworthy remark.
/// \attention Something kinda critical.

Now has an extra <p><br /> inserted in between the two blocks, causing the pages to look overly spaced out if this is a common pattern (as it is in one of our documents). Can't say for sure when the behavior changed, but it would have been in one of the last 9 commits, since that was how many I was behind when I last pulled.

(love the project, btw!)

Atom feed _URL variables not populated from FEED_ALL_ATOM

Hey there!

As requested, reporting this issue. If I set my atom feed "save as" variables like this:

FEED_ALL_ATOM = 'blog/feeds/all.atom.xml'
CATEGORY_FEED_ATOM = 'blog/feeds/%s.atom.xml'

The corresponding _URL links do not get populated from that, i.e.

  {% if FEED_ALL_ATOM_URL %}
  <link href="{{ FEED_ALL_ATOM_URL|format_siteurl|e }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME|e }}" />
  {% endif %}

fails the condition and does not add a link to the header.

Cheers and thanks for m.css!
Jonathan.

Doesn't dox2html5.py support 'retval' keyword?

Hi, I'm trying to use dox2html5.py to make a document for my project.
However, it seems not supporting retval keyword in current version.

I had tried to customize dox2html5.py script and templates to support retval, but, I couldn't success it.

Do you have some plan to support retval?

Doxygen Build Error

I must've added something, which broke the doxygen build with dox2html5.py:

Traceback (most recent call last):
  File "/Users/arvidgerstmann/p4/depot/extern/bin/shared/m.css/doxygen/dox2html5.py", line 3041, in <module>
    run(doxyfile, os.path.abspath(args.templates), args.wildcard, args.index_pages, search_merge_subtrees=not args.search_no_subtree_merging, search_add_lookahead_barriers=not args.search_no_lookahead_barriers, search_merge_prefixes=not args.search_no_prefix_merging)
  File "/Users/arvidgerstmann/p4/depot/extern/bin/shared/m.css/doxygen/dox2html5.py", line 2955, in run
    parsed = parse_xml(state, file)
  File "/Users/arvidgerstmann/p4/depot/extern/bin/shared/m.css/doxygen/dox2html5.py", line 2282, in parse_xml
    typedef = parse_typedef(state, memberdef)
  File "/Users/arvidgerstmann/p4/depot/extern/bin/shared/m.css/doxygen/dox2html5.py", line 1558, in parse_typedef
    typedef.description, templates, search_keywords, typedef.is_deprecated = parse_typedef_desc(state, element)
  File "/Users/arvidgerstmann/p4/depot/extern/bin/shared/m.css/doxygen/dox2html5.py", line 1427, in parse_typedef_desc
    assert not parsed.params and not parsed.return_value and not parsed.return_values and not parsed.exceptions
AssertionError
make: *** [html] Error 1

Missing libgs warning (latex2svg.py) and generation failing... Ubuntu 16.04

Problem was the name looked for was 'libgs', but on a linux platform it should be 'gs'
On Ubuntu 16.04 find_library gives 'libgs.so.9'
I added two lines after line 57, testing for linux... (I guess I should submit a pull request at @tuxu latex2svg)

if not hasattr(os.environ, 'LIBGS') and not find_library('libgs'):
    if sys.platform == 'darwin':
        # Fallback to homebrew Ghostscript on macOS
        homebrew_libgs = '/usr/local/opt/ghostscript/lib/libgs.dylib'
        if os.path.exists(homebrew_libgs):
            default_params['libgs'] = homebrew_libgs
    if sys.platform == 'linux':
            default_params['libgs'] = find_library('gs')
    if not default_params['libgs']:
        print('Warning: libgs not found')

And CHANGE latex2svg.py permissions chmod +x ~/m.css/pelican-plugins/m/latex2svg.py

Last, but not least, LaTeX packages... (not small ones indeed!)

sudo apt-get install texlive-base
sudo apt-get install texlive-latex-extra
sudo apt-get install texlive-fonts-extra

Make the doxygen search input stylable

Things piled up and I'm unable to look at them right now, so opening an issue. The Doxygen theme should have the search input focus outline color configurable, something like this:

.m-dox-search input:focus {
   outline-color: <something>;
}

Things to consider:

  • which color from the palette to use?
  • make the outline configurable for the whole of m.css? (for example I might use that for activated canvases on http://magnum.graphics/showcase/)
  • make it possible to configure also outline width etc. (e.g. the outline around this textarea on github is thicker and it looks nice)

Cc: @jbakosi

Releasing latex2svg as a standalone package

Hi @mosra, great content you have created here!

I'm interested in the latex2svg.py code. Having it as a standalone Python package would help others create plugins for different static site generators (I use Urubu).

Would you be willing to do this? If not, would you be OK with someone else doing it (with proper acknowledgement, of course)? I'd be happy to lend a hand.

For file level attributes, create the header with the attribute name

If I annotate a file, with something like:

/*!
 * \file bar.hpp
 * \copyright 2018 Foo Bar.
 * \author Bar Baz
 */

the original doxygen doc would generate something along the lines of:

bar.hpp
Copyright
2018 Foo Bar
Author
Bar Baz

while the current m.css, simply dumps the texts, without the headers. Wouldn't it be useful, if the headers would be retained equally?

Doxygen custom pages not linked correctly.

Hey there! :)
I am using your framework with doxygen 1.8.13 and got everything working well so far, except for the Pages page. I want to include custom page files, generated from markdown text. Basically I want to organize my tutorials that way. So say I have a file ./docs/tutorials/helloworld.md. I then include the file by adding it to the INPUT list:

INPUT = ../ \
        tutorials/helloworld.md

Doxygen links the resulting md_tutorials__helloworld.html file correctly, however when I run it through dox2html.py, the created link is invalid, since it points to md_tutorials_helloworld.html. Note that there is one underscore missing. The debug output does not give much meaningful information either, since it just tells me that it does not find a brief or detailed description. However, the correct file is created, just the link within the Pages page is invalid.

Any ideas?

Issue with Landing Page - Pelican Theme

Hi Vladimir,

Thank you for creating m.css, it seems like a lot of work has gone into it. I am unable to get a Landing Page generated in the style you describe i.e. a cover image with content on top of it.

I have added 'landed' to FORMATTED_FIELDS and have attempted to get the m.css landing page to appear like it is on the site using the index.rst from the repository. Unfortunately, I'm getting the attached.

screen shot 2017-11-12 at 19 34 08

As you can see I'm not getting content on top of the cover image apart from 'm.css'. I've attached the config file and the index.rst files.

pelicanconf.py

#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals

AUTHOR = 'Ben Karim'
SITENAME = 'DScience'
SITEURL = 'http://dscience.co.uk'
M_SITE_LOGO_TEXT = 'DScience'


PATH = 'content'

TIMEZONE = 'Europe/London'

DEFAULT_LANG = 'en'

# Feed generation is usually not desired when developing
FEED_ALL_ATOM = None
CATEGORY_FEED_ATOM = None
TRANSLATION_FEED_ATOM = None
AUTHOR_FEED_ATOM = None
AUTHOR_FEED_RSS = None

# Blogroll
LINKS = (('Pelican', 'http://getpelican.com/'),
         ('Python.org', 'http://python.org/'),

         ('Jinja2', 'http://jinja.pocoo.org/'),
         ('You can modify those links in your config file', '#'),)

# Social widget
SOCIAL = (('You can add links in your config file', '#'),
          ('Another social link', '#'),)

DEFAULT_PAGINATION = 10

# Uncomment following line if you want document-relative URLs when developing
#RELATIVE_URLS = True

THEME = 'pelican-theme'
THEME_STATIC_DIR = 'static'
M_CSS_FILES = ['https://fonts.googleapis.com/css?family=Source+Code+Pro:400,400i,600,600i%7CSource+Sans+Pro:400,400i,600&amp;subset=latin-ext',
               '/static/m-dark.css']
DIRECT_TEMPLATES = ['index']


PLUGIN_PATHS = ['pelican-plugins']
PLUGINS = ['m.abbr',
           'm.code',
           'm.components',
           'm.dox',
           'm.filesize',
           'm.gl',
           'm.gh',
           'm.htmlsanity',
           'm.images',
           'm.math']

FORMATTED_FIELDS = ['summary', 'landing', 'header', 'footer']

M_HTMLSANITY_SMART_QUOTES = True
M_HTMLSANITY_HYPHENATION = True
M_DOX_TAGFILES = [
    ('content/doxygen/corrade.tag', 'http://doc.magnum.graphics/corrade/', ['Corrade::'])]

DIRECT_TEMPLATES = []

PAGE_URL = '{slug}/'
PAGE_SAVE_AS = '{slug}/index.html'
ARTICLE_URL = '{category}/{slug}/'
ARTICLE_SAVE_AS = '{category}/{slug}/index.html'
AUTHOR_URL = 'author/{slug}/'
AUTHOR_SAVE_AS = 'author/{slug}/index.html'
CATEGORY_URL = '{slug}/'
CATEGORY_SAVE_AS = '{slug}/index.html'
TAG_URL = 'tag/{slug}/'
TAG_SAVE_AS = 'tag/{slug}/index.html'

AUTHORS_SAVE_AS = None # Not used
CATEGORIES_SAVE_AS = None # Not used
TAGS_SAVE_AS = None # Not used

SLUGIFY_SOURCE = 'basename'
PATH_METADATA = '(?P<slug>.+).rst'
M_SITE_LOGO_TEXT = 'DScience'

M_LINKS_NAVBAR1 = [('Products', 'products/', 'products', []),
                   ('Case Studies', 'case-studies/', 'case-studies', []),
                   ('Download', 'download/', 'download', [])]

M_LINKS_NAVBAR2 = [('Blog', 'blog/', '[blog]', [
                        ('News', 'blog/news/', ''),
                        ('Archive', 'blog/archive/', '')]),
                   ('Contact', 'contact/', 'contact', [])]

SITENAME = 'm.css'
SITEURL = ''

M_BLOG_NAME = 'DScience Blog'
M_BLOG_URL = 'blog/'

M_THEME_COLOR = '#222_THEME_COLOR = '#22272e'


M_LINKS_FOOTER1 = [('DScience', '/'),
                   ('Features', 'features/'),
                   ('Showcase', 'showcase/')]

M_LINKS_FOOTER2 = [('Download', 'download/'),
                   ('Packages', 'download/packages/'),
                   ('Source', 'download/source/')]

M_LINKS_FOOTER3 = [('Contact', ''),
                   ('E-mail', 'mailto:[email protected]'),
                   ('GitHub', 'https://github.com/your-brand')]

M_FINE_PRINT = """
DScience. Copyright © `You <mailto:[email protected]>`_, 2017. All rights
reserved.

Index.rst

..
    This file is part of m.css.

    Copyright © 2017 Vladimír Vondruš <[email protected]>

    Permission is hereby granted, free of charge, to any person obtaining a
    copy of this software and associated documentation files (the "Software"),
    to deal in the Software without restriction, including without limitation
    the rights to use, copy, modify, merge, publish, distribute, sublicense,
    and/or sell copies of the Software, and to permit persons to whom the
    Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included
    in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
    THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    DEALINGS IN THE SOFTWARE.
..

m.css
#####

:save_as: index.html
:date: 2017 12 13
:url:
:cover: {filename}/images/cover.jpg
:summary: A no-nonsense, no-JavaScript CSS framework and Pelican theme for
    content-oriented websites
:navbar_brand_hidden: True
:landing:

    .. container:: m-row

        .. container:: m-col-l-6 m-push-l-1 m-col-m-7 m-nopadb

            .. raw:: html

                <h1>m.css</h1>

    .. container:: m-row

        .. container:: m-col-l-6 m-push-l-1 m-col-m-7 m-nopadt

            *A no-nonsense, no-JavaScript CSS framework and Pelican theme for
            content-oriented websites.*

            Do you *hate* contemporary web development like I do? Do you also
            feel that it's not right for a web page to take *seconds* and
            *megabytes* to render? Do you want to write beautiful content but
            *can't* because the usual CMS tools make your blood boil and so you
            rather stay silent? Well, I have something for you.

        .. container:: m-col-l-3 m-push-l-2 m-col-m-4 m-push-m-1 m-col-s-6 m-push-s-3 m-col-t-8 m-push-t-2

            .. button-primary:: https://github.com/mosra/m.css/tree/master/css/m-dark.compiled.css
                :class: m-fullwidth

                Get the essence

                | some text of gzipped CSS,
                | licensed under MIT

.. container:: m-row m-container-inflate

    .. container:: m-col-m-4

        .. block-success:: *Pure* CSS and HTML

            Everything you need is some text
            of compressed CSS. This framework has exactly 0 bytes of JavaScript
            because *nobody actually needs it*. Even for responsive websites.

            .. button-success:: {filename}/images/apology.jpg
                :class: m-fullwidth

                Get the CSS

    .. container:: m-col-m-4

        .. block-warning:: Designed for *content*

            If you just want to write content with beautiful typography, you
            don't need forms, progressbars, popups, dropdowns or other cruft.
            You want fast iteration times.

            .. button-warning:: {filename}/images/apology.jpg
                :class: m-fullwidth

                Use it with Pelican

    .. container:: m-col-m-4

        .. block-info:: Authoring made *easy*

            Code snippets, math, linking to docs, presenting photography in a
            beautiful way? Or making a complex page without even needing to
            touch HTML? Everything is possible.

            .. button-info:: {filename}/images/apology.jpg
                :class: m-fullwidth

                Get Pelican plugins

.. class:: m-text-center m-noindent

*Still not convinced?* Head over to a `detailed explanation <{filename}/images/apology.jpg>`_
of this project goals and design decisions.

I was forced to add a date field as Pelican wouldn't parse it without it.

Appreciate any assistance you're able to provide.

dox2html5.py generates empty webpage

I am following the guide at http://mcss.mosra.cz/doxygen/#basic-usage, and there don't seem to be many steps to it, however I only get an empty website produced at the end when I run this on my code base. Running normal doxygen works fine, however there is no visible results of any code being parsed when using dox2html5.py.

Do you have any tips on debugging this situation? I attached the stdout I get from running the script; there are loads of warnings and so on, and I'm sure lots of parsing issues in amongst the code since the doxygen generation is poorly tested, however I am still surprised to get nothing at all generated. I have attached screenshots showing the difference between native doxygen html and dox2html5.py output.

Edit: In case you are interested in testing it yourself, the code can be downloaded from https://github.com/bjfar/gambit_1.1.git (on the branch docs_pelican), and I simply ran the command from inside the 'doc' directory as:

<path_to_repo>/m.css/doxygen/dox2html5.py --debug Doxyfile-mcss

with doxygen html generated for comparison with

doxygen doxygen.conf

Edit 2: Ahh, perhaps my doxygen version is too old, I missed your giant notice about that. I am on version 1.8.11-1, will upgrade and try again.

Edit 3: No dice, upgraded to doxygen 1.8.15, same outcome.

tmp_output.txt
doxygen
dox2html5

error message HTML sanity

Hello,

I try to use Html sanity. I put the htmlsanity.py file in a "m" directory (pelican/plugins/m).

Added to my pelicanconf.py:

PLUGINS = ['m.htmlsanity']
M_HTMLSANITY_SMART_QUOTES = True
M_HTMLSANITY_HYPHENATION = True

Installed the Pyphen li­brary using: pip install Pyphen

But I have this error:

ERROR: Cannot load plugin `m.htmlsanity`
     | ImportError: No module named m.htmlsanity

Thank you for any help.

AssertionError when generating docs

Hi, I love the look of this project. Unfortunately it's failing for me on my first try. I'm following the instructions on the website and running:
./dox2html5.py ../../../build/Doxyfile-mcss

I get the following output:

Generate XML output for dir blahblahblah... (lots of times)
lookup cache used 1885/65536 hits=14417 misses=2047
finished...
Traceback (most recent call last):
  File "./dox2html5.py", line 2862, in <module>
    run(doxyfile, os.path.abspath(args.templates), args.wildcard, args.index_pages, search_merge_subtrees=not args.search_no_subtree_merging, search_add_lookahead_barriers=not args.search_no_lookahead_barriers, search_merge_prefixes=not args.search_no_prefix_merging)
  File "./dox2html5.py", line 2780, in run
    parsed = parse_xml(state, file)
  File "./dox2html5.py", line 2308, in parse_xml
    func = parse_func(state, memberdef)
  File "./dox2html5.py", line 1462, in parse_func
    func.description, templates, params, func.return_value, func.return_values, search_keywords, func.is_deprecated = parse_func_desc(state, element)
  File "./dox2html5.py", line 1310, in parse_func_desc
    parsed = parse_desc_internal(state, element.find('detaileddescription'))
  File "./dox2html5.py", line 698, in parse_desc_internal
    add_css_class=add_css_class)
  File "./dox2html5.py", line 759, in parse_desc_internal
    out.parsed += '<li>{}</li>'.format(parse_desc(state, li))
  File "./dox2html5.py", line 1256, in parse_desc
    assert not parsed.templates and not parsed.params and not parsed.return_value
AssertionError

Any idea how to go about debugging further?

Conflicting styling/layout opening index.html inside a frame

Let me apologies in advance for what is going to be a hopelessly vague report. I am just hoping you might give me a couple of pointers to understand how I should fix this.

I have generated some basic docs for our code, and uploaded them to the server that hosts our main website, however I get some bizarre conflicts between the styling imposed by the main site and the doxygen-generated html. See here:

https://gambit.hepforge.org/doxygen/doc_howto.html

That page actually looks pretty nice, however the top nav bar and footer are screwed up for some reason. The code doc pages are much more screwed up though, e.g.

https://gambit.hepforge.org/doxygen/files.html

where the files list opens underneath the main nav bar rather than in the "normal" content window.

I realise that it is probably hard to diagnose without knowing what our main website is doing, but I am hoping that you might have a decent guess at what should look for to try and fix theses issues.

The previous raw doxygen output didn't have any such weirdnesses. It just opened in its own little area seemingly independently of the styling of the rest of the page, so I guess there is some important difference between how the old doxygen html works vs how your fancier-styled output works.

We are a bunch of scientists btw, understanding html and css is not our forte, so sorry for the dumb questions about web design :).

AssertionError parsing xml

This might be caused by a similar thing as #37, but it is not obviously the case to me so I'll report it. A colleague of mine added a documentation page to our project (attached) and managed to kill the dox2html5.py script with it:

DEBUG:root:Parsing _plugin__declaration__section.xml
WARNING:root:_plugin__declaration__section.xml: inline code has multiple lines, fallback to a code block
WARNING:root:_plugin__declaration__section.xml: no filename attribute in <programlisting>, assuming C++
WARNING:root:_plugin__declaration__section.xml: ignoring <hruler> in desc
Traceback (most recent call last):
  File "/home/farmer/repos/gambit/myfork/m.css/doxygen/dox2html5.py", line 2895, in <module>
    run(doxyfile, os.path.abspath(args.templates), args.wildcard, args.index_pages, search_merge_subtrees=not args.search_no_subtree_merging, search_add_lookahead_barriers=not args.search_no_lookahead_barriers, search_merge_prefixes=not args.search_no_prefix_merging)
  File "/home/farmer/repos/gambit/myfork/m.css/doxygen/dox2html5.py", line 2813, in run
    parsed = parse_xml(state, file)
  File "/home/farmer/repos/gambit/myfork/m.css/doxygen/dox2html5.py", line 1938, in parse_xml
    compound.description, templates, compound.sections, footer_navigation, example_navigation, search_keywords, compound.is_deprecated = parse_toplevel_desc(state, compounddef.find('detaileddescription'))
  File "/home/farmer/repos/gambit/myfork/m.css/doxygen/dox2html5.py", line 1316, in parse_toplevel_desc
    parsed = parse_desc_internal(state, element)
  File "/home/farmer/repos/gambit/myfork/m.css/doxygen/dox2html5.py", line 719, in parse_desc_internal
    add_css_class=add_css_class)
  File "/home/farmer/repos/gambit/myfork/m.css/doxygen/dox2html5.py", line 789, in parse_desc_internal
    assert row.tag == 'row'
AssertionError

I think his new page is far from bug free, however I guess it anyway should not kill the script like this.

_plugin__declaration__section_xml.txt
README_plugin_dox.txt

Edit: oh wait, I think that is the wrong page, I think this is the one that generates the problematic XML:
scanner_dox.txt

Assertion failure due to copydetails

Traceback (most recent call last):
  File "/home/dhanjit.d/dump/m.css/doxygen/dox2html5.py", line 3040, in <module>
    run(doxyfile, os.path.abspath(args.templates), args.wildcard, args.index_pages, search_merge_subtrees=not args.search_no_subtree_merging, search_add_lookahead_barriers=not args.search_no_lookahead_barriers, search_merge_prefixes=not args.search_no_prefix_merging)
  File "/home/dhanjit.d/dump/m.css/doxygen/dox2html5.py", line 2954, in run
    parsed = parse_xml(state, file)
  File "/home/dhanjit.d/dump/m.css/doxygen/dox2html5.py", line 2059, in parse_xml
    compound.description, templates, compound.sections, footer_navigation, example_navigation, search_keywords, compound.is_deprecated = parse_toplevel_desc(state, compounddef.find('detaileddescription'))
  File "/home/dhanjit.d/dump/m.css/doxygen/dox2html5.py", line 1417, in parse_toplevel_desc
    parsed = parse_desc_internal(state, element)
  File "/home/dhanjit.d/dump/m.css/doxygen/dox2html5.py", line 668, in parse_desc_internal
    parsed = parse_desc_internal(state, i)
  File "/home/dhanjit.d/dump/m.css/doxygen/dox2html5.py", line 668, in parse_desc_internal
    parsed = parse_desc_internal(state, i)
  File "/home/dhanjit.d/dump/m.css/doxygen/dox2html5.py", line 673, in parse_desc_internal
    assert not parsed.templates and not parsed.params and not parsed.return_value and not parsed.return_values and not parsed.exceptions
AssertionError

With some added logging I found that params, return_value are non empty:

When could this be? The function is quite straightforward (truncated for security reasons)

    /** some lines

      \param[in] preset Initialization preset information.
      \param[in] id The id...
      \param[in] leg leg=i means the i'th ...
      be initialized.
      \param[in] symbol_info Basic information like ...

      \return TypeId,...
 some lines...


      Example:
     */

So the function is probably not the culprit, but something else. Unable to figure out how...

Could not build the downloaded site with pelican

Hello Mosra,

I downloaded your repo and ran "pelican content" on Ubuntu with a fresh virtualenv with python 3.6. I'm running into the following error:

WARNING: Unpatched Pelican <= 3.7.1 detected, monkey-patching for expand_link filter support WARNING: Unpatched Pelican <= 3.7.1 detected, monkey-patching for htmlsanity support /m.css-master/site/content/doxygen.rst:234: (ERROR/3) Unknown interpreted text role "css".
Any idea what's wrong?

The theme looks awesome. I'm very impressed - many thanks for the great work!

Thanks,

breaks when exif data is missing

This is a slightly different issue than the one I filed earlier. If I add an image to an image-grid that doesn't have any exif data, I get a "NoneType has no attribute 'items'" exception. The following patch seems to address this::

commit 4364303f581ada5c06297cf42383d2672659a8a1 (HEAD -> master)
Author: Jelmer Vernooij <[email protected]>
Date:   Thu Dec 21 22:33:38 2017 +0000

    Don't display exif tags if there is no exif present.

diff --git a/pelican-plugins/m/images.py b/pelican-plugins/m/images.py
index b8e1217..0e7a4e1 100644
--- a/pelican-plugins/m/images.py
+++ b/pelican-plugins/m/images.py
@@ -185,7 +185,7 @@ class ImageGrid(rst.Directive):
             im = PIL.Image.open(absuri)
 
             # Get EXIF info, if it's there
-            if hasattr(im, '_getexif'):
+            if hasattr(im, '_getexif') and im._getexif() is not None:
                 exif = {
                     PIL.ExifTags.TAGS[k]: v
                     for k, v in im._getexif().items()

Support Qt's keywords

Support keywords like

  • public slots:
  • private slots:
  • signals:
  • etc...

Currently every signal / slot won't even be displayed under functions.

don't display summary and content

In index pages (archive, index) the 1st commit show all its content, but
is preceded by the summary, so first lines are repeated twice.

The same happens in article.

I removed the summary part from article_header, and placed where needed in
conditional statements.

I made pull request #14 with my patch

DATE_FORMATS on Xubuntu/Ubuntu pelicanconf.py

Hi mosra,

On Ubuntu the date format

DATE_FORMATS = {'en': ('en_US', '%b %d %Y')}

produces the error below...

I had to change to

DATE_FORMATS = {'en': ('en_US.UTF-8', '%b %d %Y')}

in order to process the site without errors. I don't know how to handle this in an elegant fashion. Testing sys.platform == 'linux'in the pelicanconf is not very nice. Perhaps just add a comment as I did on my fork:

#On Linux systems use the second format
DATE_FORMATS = {'en': ('en_US', '%b %d %Y')}
#DATE_FORMATS = {'en': ('en_US.UTF-8', '%b %d %Y')}

This is the error...

ERROR: Could not process pelican/theme.rst
  | Error: unsupported locale setting
  |___
  | Traceback (most recent call last):
  |   File "/home/gotcha/.virtualenvs/pelican/lib/python3.5/site-packages/pelican/generators.py", line 629, in generate_context
  |     context_sender=self)
  |   File "/home/gotcha/.virtualenvs/pelican/lib/python3.5/site-packages/pelican/readers.py", line 572, in read_file
  |     context=context)
  |   File "/home/gotcha/.virtualenvs/pelican/lib/python3.5/site-packages/pelican/contents.py", line 123, in __init__
  |     locale.setlocale(locale.LC_ALL, locale_string)
  |   File "/home/gotcha/.virtualenvs/pelican/lib/python3.5/locale.py", line 594, in setlocale
  |     return _setlocale(category, locale)
  | locale.Error: unsupported locale setting

Cheers...

AssertionError parsing XML

Edit: Ahh wait sorry I did something dumb, let me double check that there is actually a problem...
...yeah sorry, false alarm, nothing to see here :).

dox2html5.py fails when encountering @exception

exception commands in the documentation cause dox2html5.py to fail an assertion deep in parse_desc_internal(). The following fix will at least get the documentation to build when inserted in the if statement at line 920:

                    elif i.attrib['kind'] == 'exception':
                        # FIXME: what do we do with exceptions?
                        pass

A better solution would be to add handling for this properly and make it part of the documentation but I am not familiar enough with the code yet to add that.

Error on Ubuntu 16.04

Hello!

I am trying to compile my Doxygen documentation on Ubuntu 16.04 and to do so I have installed Python 3.6 from a PPA, along with pip3.6 and the other dependencies, Latex included. However I'm getting the following error:

[...]
(/usr/share/texlive/texmf-dist/tex/latex/graphics/dvips.def))
! Missing number, treated as zero.
<to be read again>
                   f
l.12 \definecolor{m-default}{HTML}{cafe03}

No pages of output.
Transcript written on code.log.

Traceback (most recent call last):
  File "/home/jenkins/workspace/m.css/doxygen/dox2html5.py", line 3122, in <module>
    run(doxyfile, os.path.abspath(args.templates), args.wildcard, args.index_pages, search_merge_subtrees=not args.search_no_subtree_merging, search_add_lookahead_barriers=not args.search_no_lookahead_barriers, search_merge_prefixes=not args.search_no_prefix_merging)
  File "/home/jenkins/workspace/m.css/doxygen/dox2html5.py", line 3036, in run
    parsed = parse_xml(state, file)
  File "/home/jenkins/workspace/m.css/doxygen/dox2html5.py", line 2079, in parse_xml
    compound.description, templates, compound.sections, footer_navigation, example_navigation, search_keywords, compound.is_deprecated = parse_toplevel_desc(state, compounddef.find('detaileddescription'))
  File "/home/jenkins/workspace/m.css/doxygen/dox2html5.py", line 1426, in parse_toplevel_desc
    parsed = parse_desc_internal(state, element)
  File "/home/jenkins/workspace/m.css/doxygen/dox2html5.py", line 669, in parse_desc_internal
    parsed = parse_desc_internal(state, i)
  File "/home/jenkins/workspace/m.css/doxygen/dox2html5.py", line 792, in parse_desc_internal
    add_css_class=add_css_class)
  File "/home/jenkins/workspace/m.css/doxygen/dox2html5.py", line 872, in parse_desc_internal
    row_data += '<{0}>{1}</{0}>'.format('th' if is_header else 'td', parse_desc(state, entry))
  File "/home/jenkins/workspace/m.css/doxygen/dox2html5.py", line 1387, in parse_desc
    parsed = parse_desc_internal(state, element)
  File "/home/jenkins/workspace/m.css/doxygen/dox2html5.py", line 792, in parse_desc_internal
    add_css_class=add_css_class)
  File "/home/jenkins/workspace/m.css/doxygen/dox2html5.py", line 1231, in parse_desc_internal
    depth, svg = latex2svgextra.fetch_cached_or_render('{}'.format(i.text))
  File "/home/jenkins/workspace/m.css/doxygen/../pelican-plugins/latex2svgextra.py", line 111, in fetch_cached_or_render
    out = latex2svg.latex2svg(formula, params=params)
  File "/home/jenkins/workspace/m.css/doxygen/../pelican-plugins/latex2svg.py", line 86, in latex2svg
    return latex2svg(code, params, working_directory=tmpdir)
  File "/home/jenkins/workspace/m.css/doxygen/../pelican-plugins/latex2svg.py", line 105, in latex2svg
    ret.check_returncode()
  File "/home/jenkins/python3.6/lib/python3.6/subprocess.py", line 369, in check_returncode
    self.stderr)
subprocess.CalledProcessError: Command '['latex', '-interaction', 'nonstopmode', '-halt-on-error', 'code.tex']' returned non-zero exit status 1.
doc/CMakeFiles/dox.dir/build.make:57: recipe for target 'doc/CMakeFiles/dox' failed
make[7]: *** [doc/CMakeFiles/dox] Error 1
CMakeFiles/Makefile2:2116: recipe for target 'doc/CMakeFiles/dox.dir/all' failed
make[6]: *** [doc/CMakeFiles/dox.dir/all] Error 2
CMakeFiles/Makefile2:2123: recipe for target 'doc/CMakeFiles/dox.dir/rule' failed
make[5]: *** [doc/CMakeFiles/dox.dir/rule] Error 2
Makefile:576: recipe for target 'dox' failed
make[4]: *** [dox] Error 2
doc/CMakeFiles/ISAAC-dox.dir/build.make:57: recipe for target 'doc/CMakeFiles/ISAAC-dox' failed
make[3]: *** [doc/CMakeFiles/ISAAC-dox] Error 2
CMakeFiles/Makefile2:1750: recipe for target 'doc/CMakeFiles/ISAAC-dox.dir/all' failed
make[2]: *** [doc/CMakeFiles/ISAAC-dox.dir/all] Error 2
CMakeFiles/Makefile2:1725: recipe for target 'doc/CMakeFiles/dox.dir/rule' failed
make[1]: *** [doc/CMakeFiles/dox.dir/rule] Error 2
Makefile:766: recipe for target 'dox' failed
make: *** [dox] Error 2

Can you give me a hand to understand why?

Thanks!

m.abbr depends upon the init file

Hey mate,

As the title says. The m.abbr file depends upon parse_link function found in the init file. Which is fine, probably, but the doco doesn't mention it. Need to dive in to the code when installing the plugin to find out what is causing the exception.

JF

Make it possible to configure article date header formatting

Things like the following are nice and all, but really only work for English locales:

image

The theme has a hardcoded date format '%b %d %Y', which then split()s into three parts and uses them to fill the template. That fails on some locales (ee?) with an error saying

ValueError: too many values to unpack (expected 3)

One possible workaround is to not split the values, like:

    <time class="m-date" datetime="{{ article.date.isoformat() }}">
      {% set month = article.date.strftime('%b') %}
      {% set day = article.date.strftime('%d') %}
      {% set year = article.date.strftime('%Y') %}
      {{ month }} <span class="m-date-day">{{ day }}</span> {{ year }}
    </time>

Ideally there should a way to configure the formatting and general order of items (for example like I have in the Czech locale on http://mosra.cz/blog-old/) without modifying the template itself.

Cc: @Avamander

Batch math rendering to speed up

Current state of investigation:

  • It's possible to create a "pending" node in reST that can fill the blank spaces after the whole document has been processed. That can be (ab)used to gather all math formulas from a single article to process them in batch. Sources: http://docutils.sourceforge.net/docs/howto/rst-directives.html, http://docutils.sourceforge.net/docutils/parsers/rst/directives/parts.py, http://docutils.sourceforge.net/docutils/transforms/parts.py

  • it's possible to render multiple pages with the standalone package with every one of them having different crop: https://tex.stackexchange.com/questions/307666/how-to-use-standalone-with-multiple-files

  • dvi2svgm is able to output multiple SVGs for multiple pages using the -p 1- option, a dirty in-progress patch to latex2svg that tried it on just two pages:

    diff --git a/pelican-plugins/m/latex2svg.py b/pelican-plugins/m/latex2svg.py
    old mode 100644
    new mode 100755
    index f068f47..4744b87
    --- a/pelican-plugins/m/latex2svg.py
    +++ b/pelican-plugins/m/latex2svg.py
    @@ -18,12 +18,16 @@ from tempfile import TemporaryDirectory
    from ctypes.util import find_library
    
    default_template = r"""
    -\documentclass[{{ fontsize }}pt,preview]{standalone}
    +\documentclass[multi,crop,{{ fontsize }}pt,preview]{standalone}
    {{ preamble }}
    +\standaloneenv{my}
    \begin{document}
    -\begin{preview}
    +\begin{my}
    {{ code }}
    -\end{preview}
    +\end{my}
    +\begin{my}
    +$$ x^2 = a+43 $$
    +\end{my}
    \end{document}
    """
    
    @@ -56,10 +60,10 @@ if not hasattr(os.environ, 'LIBGS') and not find_library('libgs'):
            if os.path.exists(homebrew_libgs):
                default_params['libgs'] = homebrew_libgs
        if not default_params['libgs']:
    -        print('Warning: libgs not found')
    +        print('Warning: libgs not found', file=sys.stderr)
    
    
    -def latex2svg(code, params=default_params, working_directory=None):
    +def latex2svg(code, params=default_params, working_directory='.'):
        """Convert LaTeX to SVG using dvisvgm.
    
        Parameters
    @@ -110,7 +114,7 @@ def latex2svg(code, params=default_params, working_directory=None):
    
        # Convert DVI to SVG
        try:
    -        ret = subprocess.run(shlex.split(params['dvisvgm_cmd']+' code.dvi'),
    +        ret = subprocess.run(shlex.split(params['dvisvgm_cmd']+' -p 1- code.dvi'),
                                stdout=subprocess.PIPE, stderr=subprocess.PIPE,
                                cwd=working_directory, env=env)
            ret.check_returncode()
    
  • however, each SVG still has conflicting IDs, which needs to be fixed in order to have valid HTML5 markup

  • but it seems that the SVGs have the same IDs for the same shapes, so there could be some "unique" filter to save output size, referencing each <g> only once. Also there's this: https://css-tricks.com/svg-symbol-good-choice-icons/

Things left to do:

  • Finish patch to latex2svg, make it possible to specify multiple snippets and then extract them page by page
    • Verify that also the depth attribute is preserved with multiple pages
    • Submit the patch upstream
  • Make <g> IDs unique
    • or remove duplicates
  • Update the m.math plugin to use pending nodes and batch the processing
  • Integrate batch rendering to the doxygen theme
  • Investigate possibility to batch across pages
  • Investigate the SVG <symbol> element and how widely it is supported
  • Verify HTML5 validity of the output
    • Validator also complained about <description> not being allowed, just <title>

Generation failure

Hi,

Wanted to try your theme (which I find gorgeous) on a plain Pelican installation.

I followed your guide to add theme files on Pelican,
i even copied your template rst article

And when I type make devserver I get this

 File "/home/justin/Pelican/Blog/m.css/pelican-theme/templates/article_header.html", line 4, in top-level template code
    {% set month, day, year = article.locale_date.split(' ') %}
ValueError: too many values to unpack (expected 3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.