Browse Source

doc: port to m.css's new Python-powered config.

And finally enable the color swatch postprocessing.
pull/454/head
Vladimír Vondruš 6 years ago
parent
commit
5ea2880979
  1. 1
      doc/.gitignore
  2. 22
      doc/Doxyfile-mcss
  3. 16
      doc/Doxyfile-public
  4. 20
      doc/conf-public.py
  5. 49
      doc/conf.py

1
doc/.gitignore vendored

@ -0,0 +1 @@
__pycache__/

22
doc/Doxyfile-mcss

@ -103,26 +103,4 @@ ALIASES = \
"m_deprecated_since{2}=@since deprecated in \1.\2 @deprecated" \
"m_deprecated_since_latest=@since deprecated in Git master @deprecated"
HTML_EXTRA_STYLESHEET = \
https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600&subset=latin-ext \
../css/m-dark+documentation.compiled.css
##! M_PAGE_FINE_PRINT = "<p>Magnum docs. Part of the <a href="https://magnum.graphics/">Magnum project</a>, copyright © <a href="http://mosra.cz/">Vladimír Vondruš</a> and contributors, 2010&ndash;2020.<br />Generated by <a href="https://doxygen.org/">Doxygen</a> {doxygen_version} and <a href="https://mcss.mosra.cz/">m.css</a>. Contact the team via <a href="https://github.com/mosra/magnum">GitHub</a>, <a href="https://gitter.im/mosra/magnum">Gitter</a>, <a href="mailto:info@magnum.graphics">e-mail</a> or <a href="https://twitter.com/czmosra">Twitter</a>.</p>"
##! M_SEARCH_HELP = "<p class="m-noindent">Search for symbols, directories, files, pages, OpenGL, GLSL, Vulkan and OpenAL APIs. You can omit any prefix from the symbol or file path; adding a <code>:</code> or <code>/</code> suffix lists all members of given symbol or directory.</p> <p class="m-noindent">Use <span class="m-label m-dim">&darr;</span> / <span class="m-label m-dim">&uarr;</span> to navigate through the list, <span class="m-label m-dim">Enter</span> to go. <span class="m-label m-dim">Tab</span> autocompletes common prefix, you can copy a link to the result using <span class="m-label m-dim">⌘</span> <span class="m-label m-dim">L</span> while <span class="m-label m-dim">⌘</span> <span class="m-label m-dim">M</span> produces a Markdown link.</p>"
##! M_FAVICON = favicon.ico
##! M_MAIN_PROJECT_URL = https://magnum.graphics/
##! M_LINKS_NAVBAR1 = \
##! "getting-started building cmake custom-buildsystems" \
##! "pages features platforms example-index tips utilities"
##! M_LINKS_NAVBAR2 = \
##! "namespaces" \
##! "annotated" \
##! "files" \
##! "<a href="../../../../magnum-bindings/build/doc/python/index.html">Python API</a>"
##! M_VERSION_LABELS = YES
# kate: hl Doxyfile

16
doc/Doxyfile-public

@ -102,20 +102,4 @@ ALIASES = \
GENERATE_TODOLIST = NO
GENERATE_BUGLIST = NO
HTML_EXTRA_STYLESHEET = \
https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600&subset=latin-ext \
https://static.magnum.graphics/m-dark.compiled.css \
https://static.magnum.graphics/m-dark.documentation.compiled.css
##! M_LINKS_NAVBAR2 = \
##! "namespaces" \
##! "annotated" \
##! "files" \
##! "<a href="https://doc.magnum.graphics/python/">Python API</a>"
##! M_SEARCH_DOWNLOAD_BINARY = YES
##! M_SEARCH_BASE_URL = https://doc.magnum.graphics/magnum/
##! M_SEARCH_EXTERNAL_URL = "https://google.com/search?q=site:doc.magnum.graphics+Magnum+{query}"
##! M_FAVICON = https://doc.magnum.graphics/favicon.ico
# kate: hl Doxyfile

20
doc/conf-public.py

@ -0,0 +1,20 @@
# Inherit everything from the local config
import os, sys; sys.path.append(os.path.dirname(os.path.realpath(__file__)))
from conf import *
DOXYFILE = 'Doxyfile-public'
assert "Python API" in LINKS_NAVBAR2[3][0]
LINKS_NAVBAR2[3] = ("<a href=\"https://doc.magnum.graphics/python/\">Python API</a>", [])
STYLESHEETS = [
'https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600&subset=latin-ext',
'https://static.magnum.graphics/m-dark.compiled.css',
'https://static.magnum.graphics/m-dark.documentation.compiled.css'
]
SEARCH_DOWNLOAD_BINARY = True
SEARCH_BASE_URL = "https://doc.magnum.graphics/magnum/"
SEARCH_EXTERNAL_URL = "https://google.com/search?q=site:doc.magnum.graphics+Magnum+{query}"
FAVICON = 'https://doc.magnum.graphics/favicon.ico'

49
doc/conf.py

@ -0,0 +1,49 @@
import re
DOXYFILE = 'Doxyfile-mcss'
STYLESHEETS = [
'https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600&subset=latin-ext',
'../css/m-dark+documentation.compiled.css'
]
MAIN_PROJECT_URL = 'https://magnum.graphics/'
LINKS_NAVBAR1 = [
(None, 'getting-started', [
(None, 'building'),
(None, 'cmake'),
(None, 'custom-buildsystems')
]),
(None, 'pages', [
(None, 'features'),
(None, 'platforms'),
(None, 'example-index'),
(None, 'tips'),
(None, 'utilities')
])
]
LINKS_NAVBAR2 = [
(None, 'namespaces', []),
(None, 'annotated', []),
(None, 'files', []),
("<a href=\"../../../../magnum-bindings/build/doc/python/index.html\">Python API</a>", [])
]
FINE_PRINT = """<p>Magnum docs. Part of the <a href="https://magnum.graphics/">Magnum project</a>, copyright © <a href="http://mosra.cz/">Vladimír Vondruš</a> and contributors, 2010&ndash;2020.<br />Generated by <a href="https://doxygen.org/">Doxygen</a> {doxygen_version} and <a href="https://mcss.mosra.cz/">m.css</a>. Contact the team via <a href="https://github.com/mosra/magnum">GitHub</a>, <a href="https://gitter.im/mosra/magnum">Gitter</a>, <a href="mailto:info@magnum.graphics">e-mail</a> or <a href="https://twitter.com/czmosra">Twitter</a>.</p>"""
SEARCH_HELP = """<p class="m-noindent">Search for symbols, directories, files, pages, OpenGL, GLSL, Vulkan and OpenAL APIs. You can omit any prefix from the symbol or file path; adding a <code>:</code> or <code>/</code> suffix lists all members of given symbol or directory.</p> <p class="m-noindent">Use <span class="m-label m-dim">&darr;</span> / <span class="m-label m-dim">&uarr;</span> to navigate through the list, <span class="m-label m-dim">Enter</span> to go. <span class="m-label m-dim">Tab</span> autocompletes common prefix, you can copy a link to the result using <span class="m-label m-dim">⌘</span> <span class="m-label m-dim">L</span> while <span class="m-label m-dim">⌘</span> <span class="m-label m-dim">M</span> produces a Markdown link.</p>"""
FAVICON = 'favicon.ico'
VERSION_LABELS = True
_magnum_colors_src = re.compile(r"""<span class="mh">0x(?P<hex>[0-9a-f]{6})(?P<alpha>[0-9a-f]{2})?(?P<literal>_s?rgba?f?)</span>""")
_magnum_colors_dst = r"""<span class="mh">0x\g<hex>\g<alpha>\g<literal><span class="m-code-color" style="background-color: #\g<hex>;"></span></span>"""
#def _add_color_swatch(str):
#return
M_CODE_FILTERS_POST = {
'C++': lambda str: _magnum_colors_src.sub(_magnum_colors_dst, str)
}
Loading…
Cancel
Save