Skip to content

Commit 303c16b

Browse files
authored
New documentation engine (#229)
* 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
1 parent 4f0efb2 commit 303c16b

File tree

16 files changed

+175
-151
lines changed

16 files changed

+175
-151
lines changed

.circleci/config.yml

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
11
version: 2.1
22

33
orbs:
4-
mirci: libmir/upload_docs@0.0.0
4+
mirci: libmir/upload_docs@0.0.0
55

66
jobs:
7-
build:
8-
docker:
9-
- image: libmir/circle-dlang
10-
steps:
11-
- checkout
12-
- run: git submodule sync && git submodule update --recursive --init
13-
# - run: dub test
14-
# - run: dub test -c dips
15-
- run: meson -D with_test=true build
16-
# - run: ninja -C build test -j1
17-
- run: make -f doc/Makefile html
18-
- mirci/persist_docs:
19-
from: web
7+
build:
8+
docker:
9+
- image: libmir/circle-dlang
10+
steps:
11+
- checkout
12+
- run: cp -r /repo/* ./ && cat meson.build.1 >> meson.build
13+
- run: meson build --default-library=static -D with_test=true -D with_doc=true
14+
- run: ninja -C build test -j1
15+
- run: cp -r build/web ./
16+
- mirci/persist_docs:
17+
from: web
2018

2119
workflows:
22-
version: 2
23-
build-deploy:
24-
jobs:
25-
- build
26-
- mirci/upload_docs_job:
27-
from: web
28-
to: mir-algorithm.libmir.org
29-
requires:
20+
version: 2
21+
build-deploy:
22+
jobs:
23+
- build:
24+
filters:
25+
tags:
26+
only: /^v(\d)+(\.(\d)+)+$/
27+
- mirci/upload_docs_job:
28+
from: web
29+
to: mir-algorithm.libmir.org
30+
requires:
3031
- build
31-
filters:
32-
branches:
33-
only: master
32+
filters:
33+
branches:
34+
only: master
35+
tags:
36+
only: /^v(\d)+(\.(\d)+)+$/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ mir-core
3232
mir-algorithm-test-dip1008
3333
test
3434
test.d
35+
docgen

cpp_example/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
mir_algorithm_cpp_test_exe = executable(meson.project_name() + '-test',
22
['eye.d', 'init_rcarray.d', 'main.cpp'],
3-
include_directories: mir_algorithm_dir,
3+
include_directories: directories,
44
dependencies: mir_algorithm_dep,
55
)
66

doc/custom.ddoc

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
_=
22
META_KEYWORDS=algorithm mir libmir numeric blas array vector tensor numpy math stats
3-
META_DESCRIPTION=Generic Linear Algebra Subprograms
43
ROOT_DIR =
54
SUBNAV=
65
$(SUBNAV_TEMPLATE
@@ -12,17 +11,16 @@ $(SUBNAV_TEMPLATE
1211
)
1312
_=
1413

15-
PROJECT=algorithm
1614
PAGE_TOOLS=
1715
$(DIVID tools, $(DIV,
1816
$(DIVC tip smallprint,
19-
$(HTMLTAG3 a, href="https://github.com/libmir/mir-algorithm/issues", Report a bug)
17+
$(HTMLTAG3 a, href="https://github.com/libmir/$(PROJECT)/issues", Report a bug)
2018
$(DIV,
21-
If you spot a problem with this page, click here to create a Github issue.
19+
If you spot a problem with this page, click here to create a GitHub issue.
2220
)
2321
)
2422
$(DIVC tip smallprint,
25-
<a href="https://github.com/libmir/mir-algorithm/edit/master/$(SRCFILENAME)">Improve this page</a>
23+
<a href="https://github.com/libmir/$(PROJECT)/blob/master/source/$(SRCFILENAME)">Improve this page</a>
2624
$(DIV,
2725
Quickly fork, edit online, and submit a pull request for this page.
2826
Requires a signed-in GitHub account. This works well for small changes.
@@ -53,6 +51,7 @@ $(EXTRA_HEADERS)
5351
<body id='$(TITLE)' class='$(BODYCLASS)'>
5452
$(SCRIPT document.body.className += ' have-javascript';
5553
var currentVersion = "$(LATEST_STABLE)";
54+
var currentLibrary = "$(PROJECT)";
5655
)
5756
$(DIVID top, $(DIVC helper, $(DIVC helper expand-container,
5857
<a href="$(ROOT_DIR)menu.html" title="Menu" class="hamburger expand-toggle"><span>Menu</span></a>
@@ -82,9 +81,9 @@ _=
8281
SEARCH_BOX=
8382
$(DIVID search-box,
8483
<form method="get" action="https://google.com/search">
85-
<input type="hidden" id="domains" name="domains" value="dlang.org">
84+
<input type="hidden" id="domains" name="domains" value="$(PROJECT).libmir.org">
8685
<input type="hidden" id="sourceid" name="sourceid" value="google-search">
87-
<input type="hidden" id="sitesearch" name="sitesearch" value="algorithm.dlang.io">
86+
<input type="hidden" id="sitesearch" name="sitesearch" value="$(PROJECT).libmir.org">
8887
$(SPANID search-query, <input id="q" name="q" placeholder="Search">)
8988
$(SPANID search-submit, <button type="submit"><i class="fa fa-search"></i><span>go</span></button>)
9089
</form>
@@ -93,22 +92,27 @@ _=
9392

9493
NAVIGATION=
9594
$(DIVID cssmenu, $(UL
96-
$(MENU https://github.com/libmir/mir-algorithm, Github)
97-
$(MENU https://github.com/libmir/mir-algorithm/issues, Issues)
98-
$(MENU https://gitter.im/libmir/public , Chat)
99-
$(MENU_W_SUBMENU_LINK $(ROOT_DIR)mir.html, Mir Projects)
95+
$(MENU_W_SUBMENU_LINK $(ROOT_DIR)mir.html, Mir Libraries)
10096
$(MIR_PROJECTS)
97+
$(MENU https://github.com/libmir/$(PROJECT), GitHub)
98+
$(MENU https://forum.dlang.org/group/learn , Forum)
99+
$(MENU https://github.com/libmir/$(PROJECT)/issues, Open Issue)
101100
$(MENU https://dlang.org, Dlang)
102101
))
103102
_=
104103

105104
MIR_PROJECTS=
106105
$(SUBMENU_MANUAL
107-
$(SUBMENU_LINK http://docs.mir.dlang.io, Mir)
108106
$(SUBMENU_LINK http://mir-algorithm.libmir.org, Mir Algorithm)
109-
$(SUBMENU_LINK http://docs.cpuid.dlang.io, CPUID)
110-
$(SUBMENU_LINK http://docs.glas.dlang.io, GLAS)
111-
$(SUBMENU_LINK http://docs.random.dlang.io, Random Numbers Generators)
107+
$(SUBMENU_LINK http://mir-core.libmir.org, Mir Core)
108+
$(SUBMENU_LINK http://mir-runtime.libmir.org, Mir Runtime)
109+
$(SUBMENU_LINK http://mir-random.libmir.org, Mir Random)
110+
$(SUBMENU_LINK http://mir-optim.libmir.org, Mir Optim)
111+
$(SUBMENU_LINK http://mir-cpuid.libmir.org, Mir CPUID)
112+
$(SUBMENU_LINK http://mir-blas.libmir.org, Mir BLAS)
113+
$(SUBMENU_LINK http://mir-lapacl.libmir.org, Mir LAPACK)
114+
$(SUBMENU_LINK http://mir.libmir.org, Mir)
115+
$(SUBMENU_LINK http://asdf.libmir.org, ASDF - JSON library)
112116
)
113117
_=
114118

doc/gen_modlist.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* License: $(WEB boost.org/LICENSE_1_0.txt, Boost License 1.0).
66
* Authors: $(WEB code.dawg.eu, Martin Nowak)
77
*/
8-
import std.algorithm, std.file, std.path, std.stdio, std.string, std.range;
8+
import std.algorithm, std.file, std.path, std.stdio, std.string, std.range, std.exception;
99

1010
struct Tree
1111
{
@@ -73,7 +73,7 @@ struct Tree
7373
ref Tree opIndex(string part)
7474
{
7575
auto tail = leaves.find!((tr, pkg) => tr.name == pkg)(part);
76-
assert(!tail.empty, part);
76+
enforce(!tail.empty, part);
7777
return tail.front;
7878
}
7979

doc/run_examples_custom.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function wrapIntoMain(code) {
1111
var currentPackage = $('body')[0].id;
1212
// BUMP mir-algorithm image here: https://github.com/dlang-tour/core-exec/blob/master/Dockerfile
1313
// run.dlang.io frontend: https://github.com/dlang-tour/core/blob/master/public/static/js/tour-controller.js#L398
14-
var codeOut = '/+dub.sdl:\ndependency "mir-algorithm" version="~>'+currentVersion+'"\n+/\n';
14+
var codeOut = '/+dub.sdl:\ndependency "'+currentLibrary+'" version="~>'+currentVersion+'"\n+/\n';
1515

1616
// dynamically wrap into main if needed
1717
if (code.indexOf("void main") >= 0) {

index.d

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ $(BOOKTABLE ,
2020
$(TR $(TDNW $(MREF mir,math,numeric)) $(TD Simple numeric algorithms))
2121
$(TR $(TDNW $(MREF mir,math,sum)) $(TD Various precise summation algorithms))
2222
$(TR $(TDNW $(MREF mir,math,stat)) $(TD Basic API for statistics))
23-
$(TR $(TDNW $(MREF mir,math,constant)) $(TD Math constants))
2423
$(TR $(TDNW $(MREF mir,polynomial)) $(TD Polynomial ref-counted structure))
2524
$(TR $(TDNW $(MREF mir,interpolate)★) $(TD Interpolation algorithms))
2625
$(LEADINGROW Reference counting)

0 commit comments

Comments
 (0)