Skip to content

Commit

Permalink
New documentation engine (#229)
Browse files Browse the repository at this point in the history
* new docs build system

* update ci config

* update meson build

* wip

* wip

* wip

* wip

* wip

* fix index.d

* update config

* ditto

* update ci

* update circle ci

* wip

* wip

* wip

* wip
  • Loading branch information
9il committed Mar 27, 2020
1 parent 4f0efb2 commit 303c16b
Show file tree
Hide file tree
Showing 16 changed files with 175 additions and 151 deletions.
53 changes: 28 additions & 25 deletions .circleci/config.yml
@@ -1,33 +1,36 @@
version: 2.1

orbs:
mirci: libmir/upload_docs@0.0.0
mirci: libmir/upload_docs@0.0.0

jobs:
build:
docker:
- image: libmir/circle-dlang
steps:
- checkout
- run: git submodule sync && git submodule update --recursive --init
# - run: dub test
# - run: dub test -c dips
- run: meson -D with_test=true build
# - run: ninja -C build test -j1
- run: make -f doc/Makefile html
- mirci/persist_docs:
from: web
build:
docker:
- image: libmir/circle-dlang
steps:
- checkout
- run: cp -r /repo/* ./ && cat meson.build.1 >> meson.build
- run: meson build --default-library=static -D with_test=true -D with_doc=true
- run: ninja -C build test -j1
- run: cp -r build/web ./
- mirci/persist_docs:
from: web

workflows:
version: 2
build-deploy:
jobs:
- build
- mirci/upload_docs_job:
from: web
to: mir-algorithm.libmir.org
requires:
version: 2
build-deploy:
jobs:
- build:
filters:
tags:
only: /^v(\d)+(\.(\d)+)+$/
- mirci/upload_docs_job:
from: web
to: mir-algorithm.libmir.org
requires:
- build
filters:
branches:
only: master
filters:
branches:
only: master
tags:
only: /^v(\d)+(\.(\d)+)+$/
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -32,3 +32,4 @@ mir-core
mir-algorithm-test-dip1008
test
test.d
docgen
2 changes: 1 addition & 1 deletion cpp_example/meson.build
@@ -1,6 +1,6 @@
mir_algorithm_cpp_test_exe = executable(meson.project_name() + '-test',
['eye.d', 'init_rcarray.d', 'main.cpp'],
include_directories: mir_algorithm_dir,
include_directories: directories,
dependencies: mir_algorithm_dep,
)

Expand Down
34 changes: 19 additions & 15 deletions doc/custom.ddoc
@@ -1,6 +1,5 @@
_=
META_KEYWORDS=algorithm mir libmir numeric blas array vector tensor numpy math stats
META_DESCRIPTION=Generic Linear Algebra Subprograms
ROOT_DIR =
SUBNAV=
$(SUBNAV_TEMPLATE
Expand All @@ -12,17 +11,16 @@ $(SUBNAV_TEMPLATE
)
_=

PROJECT=algorithm
PAGE_TOOLS=
$(DIVID tools, $(DIV,
$(DIVC tip smallprint,
$(HTMLTAG3 a, href="https://github.com/libmir/mir-algorithm/issues", Report a bug)
$(HTMLTAG3 a, href="https://github.com/libmir/$(PROJECT)/issues", Report a bug)
$(DIV,
If you spot a problem with this page, click here to create a Github issue.
If you spot a problem with this page, click here to create a GitHub issue.
)
)
$(DIVC tip smallprint,
<a href="https://github.com/libmir/mir-algorithm/edit/master/$(SRCFILENAME)">Improve this page</a>
<a href="https://github.com/libmir/$(PROJECT)/blob/master/source/$(SRCFILENAME)">Improve this page</a>
$(DIV,
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
Expand Down Expand Up @@ -53,6 +51,7 @@ $(EXTRA_HEADERS)
<body id='$(TITLE)' class='$(BODYCLASS)'>
$(SCRIPT document.body.className += ' have-javascript';
var currentVersion = "$(LATEST_STABLE)";
var currentLibrary = "$(PROJECT)";
)
$(DIVID top, $(DIVC helper, $(DIVC helper expand-container,
<a href="$(ROOT_DIR)menu.html" title="Menu" class="hamburger expand-toggle"><span>Menu</span></a>
Expand Down Expand Up @@ -82,9 +81,9 @@ _=
SEARCH_BOX=
$(DIVID search-box,
<form method="get" action="https://google.com/search">
<input type="hidden" id="domains" name="domains" value="dlang.org">
<input type="hidden" id="domains" name="domains" value="$(PROJECT).libmir.org">
<input type="hidden" id="sourceid" name="sourceid" value="google-search">
<input type="hidden" id="sitesearch" name="sitesearch" value="algorithm.dlang.io">
<input type="hidden" id="sitesearch" name="sitesearch" value="$(PROJECT).libmir.org">
$(SPANID search-query, <input id="q" name="q" placeholder="Search">)
$(SPANID search-submit, <button type="submit"><i class="fa fa-search"></i><span>go</span></button>)
</form>
Expand All @@ -93,22 +92,27 @@ _=

NAVIGATION=
$(DIVID cssmenu, $(UL
$(MENU https://github.com/libmir/mir-algorithm, Github)
$(MENU https://github.com/libmir/mir-algorithm/issues, Issues)
$(MENU https://gitter.im/libmir/public , Chat)
$(MENU_W_SUBMENU_LINK $(ROOT_DIR)mir.html, Mir Projects)
$(MENU_W_SUBMENU_LINK $(ROOT_DIR)mir.html, Mir Libraries)
$(MIR_PROJECTS)
$(MENU https://github.com/libmir/$(PROJECT), GitHub)
$(MENU https://forum.dlang.org/group/learn , Forum)
$(MENU https://github.com/libmir/$(PROJECT)/issues, Open Issue)
$(MENU https://dlang.org, Dlang)
))
_=

MIR_PROJECTS=
$(SUBMENU_MANUAL
$(SUBMENU_LINK http://docs.mir.dlang.io, Mir)
$(SUBMENU_LINK http://mir-algorithm.libmir.org, Mir Algorithm)
$(SUBMENU_LINK http://docs.cpuid.dlang.io, CPUID)
$(SUBMENU_LINK http://docs.glas.dlang.io, GLAS)
$(SUBMENU_LINK http://docs.random.dlang.io, Random Numbers Generators)
$(SUBMENU_LINK http://mir-core.libmir.org, Mir Core)
$(SUBMENU_LINK http://mir-runtime.libmir.org, Mir Runtime)
$(SUBMENU_LINK http://mir-random.libmir.org, Mir Random)
$(SUBMENU_LINK http://mir-optim.libmir.org, Mir Optim)
$(SUBMENU_LINK http://mir-cpuid.libmir.org, Mir CPUID)
$(SUBMENU_LINK http://mir-blas.libmir.org, Mir BLAS)
$(SUBMENU_LINK http://mir-lapacl.libmir.org, Mir LAPACK)
$(SUBMENU_LINK http://mir.libmir.org, Mir)
$(SUBMENU_LINK http://asdf.libmir.org, ASDF - JSON library)
)
_=

Expand Down
4 changes: 2 additions & 2 deletions doc/gen_modlist.d
Expand Up @@ -5,7 +5,7 @@
* License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: $(WEB code.dawg.eu, Martin Nowak)
*/
import std.algorithm, std.file, std.path, std.stdio, std.string, std.range;
import std.algorithm, std.file, std.path, std.stdio, std.string, std.range, std.exception;

struct Tree
{
Expand Down Expand Up @@ -73,7 +73,7 @@ struct Tree
ref Tree opIndex(string part)
{
auto tail = leaves.find!((tr, pkg) => tr.name == pkg)(part);
assert(!tail.empty, part);
enforce(!tail.empty, part);
return tail.front;
}

Expand Down
2 changes: 1 addition & 1 deletion doc/run_examples_custom.js
Expand Up @@ -11,7 +11,7 @@ function wrapIntoMain(code) {
var currentPackage = $('body')[0].id;
// BUMP mir-algorithm image here: https://github.com/dlang-tour/core-exec/blob/master/Dockerfile
// run.dlang.io frontend: https://github.com/dlang-tour/core/blob/master/public/static/js/tour-controller.js#L398
var codeOut = '/+dub.sdl:\ndependency "mir-algorithm" version="~>'+currentVersion+'"\n+/\n';
var codeOut = '/+dub.sdl:\ndependency "'+currentLibrary+'" version="~>'+currentVersion+'"\n+/\n';

// dynamically wrap into main if needed
if (code.indexOf("void main") >= 0) {
Expand Down
1 change: 0 additions & 1 deletion index.d
Expand Up @@ -20,7 +20,6 @@ $(BOOKTABLE ,
$(TR $(TDNW $(MREF mir,math,numeric)) $(TD Simple numeric algorithms))
$(TR $(TDNW $(MREF mir,math,sum)) $(TD Various precise summation algorithms))
$(TR $(TDNW $(MREF mir,math,stat)) $(TD Basic API for statistics))
$(TR $(TDNW $(MREF mir,math,constant)) $(TD Math constants))
$(TR $(TDNW $(MREF mir,polynomial)) $(TD Polynomial ref-counted structure))
$(TR $(TDNW $(MREF mir,interpolate)★) $(TD Interpolation algorithms))
$(LEADINGROW Reference counting)
Expand Down

0 comments on commit 303c16b

Please sign in to comment.