Skip to content

Commit

Permalink
📚 🐛 [doc] Fix doc generation
Browse files Browse the repository at this point in the history
Problem:
- Custom mkdocs version has to be used to generate doc but it can't be installed anymore.

Solution:
- Update to the newest version of mkdocs - 15.3.
  • Loading branch information
krzysztof-jusiak committed Sep 30, 2019
1 parent 4525a24 commit 067d863
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 38 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/BUILD*/
/*.log

*.out
11 changes: 6 additions & 5 deletions doc/mkdocs.yml → .mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
copyright: Copyright © 2016-2017

copyright: Copyright © 2016-2019
site_name: "[Boost].SML"
site_url: http://boost-experimental.github.io/sml
site_author: Kris Jusiak
repo_url: https://github.com/boost-experimental/sml
repo_name: sml
docs_dir: .
docs_dir: doc
use_directory_urls: false
theme_dir: themes/boost-experimental
theme:
name: null
custom_dir: !!python/object/apply:os.getenv ["MKDOCS_THEME_DIR"]
google_analytics: ['UA-73083568-1', 'auto']
extra_javascript: []
extra_css: []

pages:
nav:
- Introduction: index.md
- Overview: overview.md
- Features/Benchmarks: benchmarks.md
Expand Down
11 changes: 5 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,11 @@ script:
- if [ "${CXX}" != "" ] && [ "${COVERAGE}" != "" ]; then (travis_wait make test); fi
- if [ "${CHECK}" != "" ]; then (travis_wait make check); fi
- if [ "${TRAVIS_PULL_REQUEST}" == "false" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${DOCUMENTATION}" != "" ]; then (
pip install tornado==4.5.3 https://github.com/mkdocs/mkdocs/archive/b30f38fe299738e8ce614e53c3342cc8bef02b5b.zip -U --user
&& git clone https://github.com/boost-experimental/sml && cd sml && rm -rf *
&& git checkout -b gh-pages -t origin/gh-pages && git reset --hard && cd ..
&& MKDOCS_THEME=boost-experimental MKDOCS_SITE=../sml make doc
&& MKDOCS_THEME=boost-classic MKDOCS_SITE=../sml/boost make doc readme
&& cd sml && git add -A . && git commit -am "doc update"
pip install mkdocs -U --user && git clone https://github.com/boost-experimental/sml
&& cd sml && rm -rf * && git checkout -b gh-pages -t origin/gh-pages && git reset --hard && rm -rf * && cd ..
&& MKDOCS_THEME=boost-experimental MKDOCS_SITE=site make doc
&& MKDOCS_THEME=boost-classic MKDOCS_SITE=site/boost make doc readme
&& mv site/* sml && cd sml && git add -A . && git commit -am "doc update"
&& git push --force --quiet "https://${GH_TOKEN}@github.com/boost-experimental/sml.git"); fi

after_success:
Expand Down
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,15 @@ static_analysis:

doc: readme doc_$(MKDOCS_THEME)

doc_%:
cd doc && $(MKDOCS) build --clean --theme-dir themes/$* --site-dir $(MKDOCS_SITE)
doc_boost-experimental:
MKDOCS_THEME_DIR='doc/themes/boost-experimental' $(MKDOCS) build --quiet --config-file .$(MKDOCS).yml --clean --site-dir $(MKDOCS_SITE)

doc_boost-classic:
cd doc && $(PYTHON) themes/boost-classic/scripts/update_markdown.py . https://raw.githubusercontent.com/boost-experimental/sml/master
cd doc && $(MKDOCS) build --clean --theme-dir themes/boost-classic --site-dir $(MKDOCS_SITE)
$(PYTHON) doc/themes/boost-classic/scripts/update_markdown.py . https://raw.githubusercontent.com/boost-experimental/sml/master
MKDOCS_THEME_DIR='doc/themes/boost-classic' $(MKDOCS) build --quiet --config-file .$(MKDOCS).yml --clean --site-dir $(MKDOCS_SITE)

readme:
cd doc && $(PYTHON) scripts/update_readme_toc.py mkdocs.yml ../README.md http://boost-experimental.github.io/sml
$(PYTHON) doc/scripts/update_readme_toc.py doc .$(MKDOCS).yml README.md http://boost-experimental.github.io/sml

clean:
find example test -iname "*.out" -or -iname "*.obj" | xargs rm -f

1 change: 0 additions & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ class SmlConan(ConanFile):

def package(self):
self.copy("*", src="include", dst="include")

1 change: 0 additions & 1 deletion doc/themes/boost-classic/README.md

This file was deleted.

8 changes: 4 additions & 4 deletions doc/themes/boost-classic/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% if page_description %}<meta name="description" content="{{ page_description }}">{% endif %}
{% if site_author %}<meta name="author" content="{{ site_author }}">{% endif %}
{% if canonical_url %}<link rel="canonical" href="{{ canonical_url }}">{% endif %}
<title>{% if page_title %}{{ page_title }} - {% endif %}{{ site_name }}</title>
<title>{% if page.title %}{{ page.title }} - {% endif %}{{ config.site_name }}</title>

<link href="{{ base_url }}/css/boostbook.css" rel="stylesheet">
<link href="{{ base_url }}/css/github.css" rel="stylesheet">
Expand All @@ -31,9 +31,9 @@
<div class="chapter">
<div class="titlepage"><div>
<div><h2 class="title">
<a></a>{{ site_name }}</h2></div>
<a></a>{{ config.site_name }}</h2></div>
<div><div class="author"><h3 class="author">
{{ site_author }}
{{ config.site_author }}
</h3></div></div>
<div><p class="copyright">{% if copyright %}{{ copyright }}{% endif %}</p></div>
<div><div class="legalnotice">
Expand All @@ -53,7 +53,7 @@
{% endif %}

<div class="section">
{{ content }}
{{ page.content }}
</div>

<script src="{{ base_url }}/js/highlight.pack.js"></script>
Expand Down
1 change: 1 addition & 0 deletions doc/themes/boost-classic/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% extends "base.html" %}
7 changes: 5 additions & 2 deletions doc/themes/boost-classic/scripts/update_markdown.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
#update_md.py . http://boost-experimental.github.io/di/cpp14
#update_md.py . http://boost-experimental.github.io/sml/master

import fileinput, sys, os, glob

Expand All @@ -21,7 +21,7 @@ def print_cpp(filename):

def update_md(filename):
for line in fileinput.input(filename, inplace=True):
if line.find("[CPP]") != -1:
if line.find("[CPP]") != -1 or line.find("[CPP*]") != -1:
print_cpp("../" + line.split("(")[1][len(sys.argv[2])+1:].split(")")[0])
href = line.split("(")[1].split(")")[0]
print "* [" + href + "](" + href + ")"
Expand All @@ -36,6 +36,9 @@ def update_md(filename):
elif line.find("[IFRAME]") != -1:
src = line.split("(")[1].split(")")[0]
print "[" + src + "](" + src + ")"
elif line.find("[YOUTUBE]") != -1:
src = line.split("(")[1].split(")")[0]
print "[" + src + "](" + src + ")"
else:
print(line),

Expand Down
12 changes: 6 additions & 6 deletions doc/themes/boost-classic/toc.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<div class="toc">
<dl class="toc">
{% for toc_item in toc %}
{% if toc_item.children %}
<dt><span class="section"><a href="{{ toc_item.url }}">{{ toc_item.title }}</a></span></dt>
{% for nav_item in nav %}
{% if nav_item.children %}
<dt><span class="section"><a href="{{ nav_item.url }}">{{ nav_item.title }}</a></span></dt>
<dd><dl>
{% for toc_item in toc_item.children %}
<dt><span class="section"><a href="{{ toc_item.url }}">{{ toc_item.title }}</a></span></dt>
{% for nav_item in nav_item.children %}
<dt><span class="section"><a href="{{ nav_item.url }}">{{ nav_item.title }}</a></span></dt>
{% endfor %}
</dl></dd>
{% else %}
<dt><span class="section"><a href="{{ toc_item.url }}">{{ toc_item.title }}</a></span></dt>
<dt><span class="section"><a href="{{ nav_item.url }}">{{ nav_item.title }}</a></span></dt>
{% endif %}
{% endfor %}
</dl>
Expand Down
12 changes: 6 additions & 6 deletions doc/themes/boost-experimental/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% if page_description %}<meta name="description" content="{{ page_description }}">{% endif %}
{% if site_author %}<meta name="author" content="{{ site_author }}">{% endif %}
{% if config.site_author %}<meta name="author" content="{{ config.site_author }}">{% endif %}
{% block htmltitle %}
<title>{% if page_title %}{{ page_title }} - {% endif %}{{ site_name }}</title>
<title>{% if page.title %}{{ page.title }} - {% endif %}{{ config.site_name }}</title>
{% endblock %}

{% if favicon %}<link rel="shortcut icon" href="{{ favicon }}">
Expand All @@ -29,7 +29,7 @@
{% if current_page %}
<script>
// Current page data
var mkdocs_page_name = "{{ page_title }}";
var mkdocs_page_name = "{{ page.title }}";
var mkdocs_page_input_path = "{{ current_page.input_path }}";
var mkdocs_page_url = "{{ current_page.abs_url }}";
</script>
Expand Down Expand Up @@ -74,7 +74,7 @@
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">

<img src="{{base_url}}/img/boost.png" />
<a href="{{ homepage_url }}" class="icon icon-home" style="font-weight:bold;text-align:left;padding:0.809em;color:#fcfcfc;margin-bottom:0.809em"> {{ site_name }}</a>
<a href="{{ homepage_url }}" class="icon icon-home" style="font-weight:bold;text-align:left;padding:0.809em;color:#fcfcfc;margin-bottom:0.809em"> {{ config.site_name }}</a>

<div class="wy-side-nav-search">
{% include "searchbox.html" %}
Expand All @@ -96,7 +96,7 @@
{# MOBILE NAV, TRIGGLES SIDE NAV ON TOGGLE #}
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="{{ homepage_url }}">{{ site_name }}</a>
<a href="{{ homepage_url }}">{{ config.site_name }}</a>
</nav>

{# PAGE CONTENT #}
Expand All @@ -106,7 +106,7 @@
<div role="main">
<div class="section">
{% block content %}
{{ content }}
{{ page.content }}
{% endblock %}
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions doc/themes/boost-experimental/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% extends "base.html" %}
5 changes: 5 additions & 0 deletions doc/themes/boost-experimental/mkdocs_theme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# The theme configuration file
# Defines custom settings specific to this theme.

# Instructs the search plugin to include the search.html template
include_search_page: true

0 comments on commit 067d863

Please sign in to comment.