Skip to content

Commit 582b13b

Browse files
Update the nav bar and fix some doc bugs (libsemigroups#693)
1 parent 06e9431 commit 582b13b

23 files changed

Lines changed: 766 additions & 400 deletions

docs/Doxyfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ TOC_INCLUDE_HEADINGS = 5
398398
# The default value is: DOXYGEN.
399399
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
400400

401-
MARKDOWN_ID_STYLE = DOXYGEN
401+
MARKDOWN_ID_STYLE = GITHUB
402402

403403
# When enabled Doxygen tries to link words that correspond to documented
404404
# classes, or namespaces to their corresponding documentation. Such a link can
@@ -531,7 +531,7 @@ LOOKUP_CACHE_SIZE = 0
531531
# DOT_NUM_THREADS setting.
532532
# Minimum value: 0, maximum value: 32, default value: 1.
533533

534-
NUM_PROC_THREADS = 8
534+
NUM_PROC_THREADS = 0
535535

536536
# If the TIMESTAMP tag is set different from NO then each generated page will
537537
# contain the date or date and time when the page was generated. Setting this to
@@ -1123,7 +1123,6 @@ EXCLUDE = ../include/libsemigroups/detail/bruidhinn-traits.hpp \
11231123
../include/libsemigroups/detail/multi-string-view.hpp \
11241124
../include/libsemigroups/detail/path-iterators.hpp \
11251125
../include/libsemigroups/detail/pool.hpp \
1126-
../include/libsemigroups/detail/report.hpp \
11271126
../include/libsemigroups/detail/stl.hpp \
11281127
../include/libsemigroups/detail/string.hpp \
11291128
../include/libsemigroups/detail/timer.hpp \

docs/DoxygenLayout.xml

Lines changed: 419 additions & 110 deletions
Large diffs are not rendered by default.

docs/install.md

Lines changed: 40 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33
## Installing with conda
44

5-
This installation method assumes that you have anaconda or miniconda
6-
installed. See the [getting started](http://bit.ly/33B0Vfs) and
7-
[miniconda download page](https://conda.io/miniconda.html) on the
8-
[conda](https://conda.io/) website.
5+
This installation method assumes that you have a working version of `conda`.
6+
See the [getting started](https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html)
7+
on the [conda](https://conda.io/) website.
98

10-
Activate the [conda-forge](https://conda-forge.github.io/) package
9+
Activate the [conda-forge](https://conda-forge.org/) package
1110
repository:
1211

1312
conda config --add channels conda-forge
@@ -19,9 +18,9 @@ Install `libsemigroups`:
1918
## From the sources
2019

2120
Building `libsemigroups` from the source files requires a C++ compiler
22-
supporting the C++14 standard, `autoconf`, and `automake`. Building the
21+
supporting the C++17 standard, `autoconf`, and `automake`. Building the
2322
documentation from source has some additional requirements that are
24-
detailed [here](Building%20the%20documentation%20from%20source).
23+
detailed in the section [Building the documentation](index.md#building-the-documentation).
2524

2625
### From the github repo
2726

@@ -35,51 +34,43 @@ To build `libsemigroups` from the github repository:
3534

3635
To build `libsemigroups` from a release archive:
3736

38-
::: parsed-literal
39-
curl -L -O
40-
<https://github.com/libsemigroups/libsemigroups/releases/latest/download/libsemigroups-%7Clibsemigroups-version>libsemigroups-versionlibsemigroups-versionlibsemigroups-version\|
41-
./configure && make -j8 && sudo make install
42-
:::
37+
curl -L -O https://github.com/libsemigroups/libsemigroups/releases/latest/download/libsemigroups-3.0.0.tar.gz
38+
tar -xf libsemigroups-3.0.0.tar.gz
39+
rm -f libsemigroups-3.0.0.tar.gz
40+
cd libsemigroups-3.0.0
41+
./configure && make -j8 && sudo make install
4342

4443
### Docker
4544

46-
If you have [Docker](https://www.docker.com) installed, you can download
47-
an [x86 docker
48-
image](https://hub.docker.com/repository/docker/libsemigroups/libsemigroups-docker)
45+
If you have [Docker](https://www.docker.com) installed, you can download an
46+
[x86 docker image](https://hub.docker.com/repository/docker/libsemigroups/libsemigroups-docker)
4947
for `libsemigroups` as follows:
5048

51-
::: parsed-literal
52-
docker pull libsemigroups/libsemigroups-docker
53-
:::
49+
docker pull libsemigroups/libsemigroups-docker
5450

55-
or an [arm docker
56-
image](https://hub.docker.com/repository/docker/libsemigroups/libsemigroups-docker-arm)
51+
or an [arm docker image](https://hub.docker.com/repository/docker/libsemigroups/libsemigroups-docker-arm)
5752
as follows
5853

59-
::: parsed-literal
60-
docker pull libsemigroups/libsemigroups-docker-arm
61-
:::
54+
docker pull libsemigroups/libsemigroups-docker-arm
6255

6356
and run it by doing
6457

65-
::: parsed-literal
66-
docker run \--rm -it libsemigroups/libsemigroups-docker docker run \--rm
67-
-it libsemigroups/libsemigroups-docker-arm
68-
:::
58+
docker run --rm -it libsemigroups/libsemigroups-docker
6959

70-
If you want to use a specific version of `libsemigroups`, then use:
60+
or
7161

72-
::: parsed-literal
73-
docker pull libsemigroups/libsemigroups-docker:version-1.0.9 docker run
74-
\--rm -it libsemigroups/libsemigroups-docker:version-1.0.9
75-
:::
62+
docker run --rm -it libsemigroups/libsemigroups-docker-arm
63+
64+
If you want to use a specific version of `libsemigroups`, such as 1.0.9, then
65+
use:
66+
67+
docker pull libsemigroups/libsemigroups-docker:version-1.0.9
68+
docker run --rm -it libsemigroups/libsemigroups-docker:version-1.0.9
7669

7770
or, for the latest version, use:
7871

79-
::: parsed-literal
80-
docker pull libsemigroups/libsemigroups-docker:latest docker run \--rm
81-
-it libsemigroups/libsemigroups-docker:latest
82-
:::
72+
docker pull libsemigroups/libsemigroups-docker:latest
73+
docker run --rm -it libsemigroups/libsemigroups-docker:latest
8374

8475
## Configuration options
8576

@@ -96,13 +87,12 @@ configuration options are available for `libsemigroups`:
9687
| \--with-external-fmt | do not use the included copy of fmt (default=no) |
9788
| \--with-external-eigen | do not use the included copy of eigen (default=no) |
9889
| \--disable-popcnt | do not use \_\_builtin_popcountl (default=yes) |
99-
| \--disable-clzll | do not use \_\_builtin_ctzll (default=yes) |
90+
| \--disable-clzll | do not use \_\_builtin_clzll (default=yes) |
10091

101-
Debug mode and verbose mode significantly degrade the performance of
102-
`libsemigroups`. Compiling with `fmt` enabled increases build times
103-
significantly. Note that the flags `--enable-fmt` and
104-
`--with-external-fmt` are independent of each other, and so both flags
105-
should be included to enable `fmt` and use an external `fmt`.
92+
Debug mode significantly degrades the performance of `libsemigroups`. Note that
93+
the flags `--enable-eigen` and `--with-external-eigen` are independent of each
94+
other, and so both flags should be included to enable `eigen` and use an
95+
external `eigen`.
10696

10797
## Make install
10898

@@ -128,28 +118,19 @@ above then
128118
PKG_CONFIG_PATH=/foo/bar/lib/pkgconfig pkg-config --modversion libsemigroups
129119

130120
will print the version of the installed `libsemigroups`. (As usual,
131-
`PKG_CONFIG_PATH` may be exported, added to shell configuration, etc.)
121+
`PKG_CONFIG_PATH` may be exported, added to shell configuration, etc.).
132122

133123
## Building the documentation
134124

135-
The following are required to be able to build the documentation:
136-
137-
1. `python3`
138-
2. `doxygen`
139-
3. the python packages:
140-
`sphinx bs4 lxml breathe pyyaml sphinx_rtd_theme sphinx_copybutton sphinxcontrib-bibtex`
141-
142-
Assuming you already have `python3` install, on Mac OSX you can install
143-
all of the above by doing:
144-
145-
brew install doxygen sphinx
146-
pip3 install -r docs/requirements.txt
125+
To build the documentation, a version of `doxygen` is required. Instructions on
126+
how to do this can be found on Doxygen's
127+
[Installation page](https://www.doxygen.nl/manual/install.html).
147128

148-
Then it ought to be possible to just run `make doc` in the
149-
`libsemigroups` directory.
129+
Then, it ought to be possible to just run `make doc` in the
130+
`libsemigroups` directory, and the documentation will be generated.
150131

151132
## Issues
152133

153134
If you find any problems with `libsemigroups`, or have any suggestions
154-
for features that you'd like to see, please use the [issue
155-
tracker](https://github.com/libsemigroups/libsemigroups/issues).
135+
for features that you'd like to see, please use the
136+
[issue tracker](https://github.com/libsemigroups/libsemigroups/issues).

etc/check_doxygen_line_breaks.py

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/usr/bin/env python3
2+
"""Check for bad linebreaks within doxygen commands.
3+
4+
The script should be run from the libsemigroups root directory. It searches
5+
every .hpp file in the libsemigroups directory for doxygen-style documentation
6+
lines that end with one of the following:
7+
* \\ref
8+
* \\c
9+
* \\p
10+
* \\copydoc
11+
"""
12+
import re
13+
from glob import iglob
14+
15+
BOLD_TEXT = "\033[1m"
16+
YELLOW = "\033[93m"
17+
END_COLOUR = "\033[0m"
18+
19+
command_with_line_break = re.compile(
20+
r"//!.*((?:\\ref)|(?:\\c)|(?:\\p)(?:\\copydoc))(\s+)?$",
21+
re.IGNORECASE | re.MULTILINE,
22+
)
23+
24+
globs = ["include/libsemigroups/*.hpp", "include/libsemigroups/detail*.hpp"]
25+
26+
27+
def process_file(filename):
28+
"""Check for doxygen commands that contain line breaks in the specified
29+
file.
30+
"""
31+
with open(filename, "r") as f:
32+
check_doc = True
33+
for line_no, line in enumerate(f):
34+
if check_doc and "/*" in line:
35+
check_doc = False
36+
if not check_doc and "*/" in line:
37+
check_doc = True
38+
if not check_doc:
39+
continue
40+
41+
command_match = command_with_line_break.search(line)
42+
if command_match:
43+
command = command_match[1]
44+
print(
45+
f"{YELLOW}warning: {command} appears at the end of the "
46+
f"line at {filename}:{line_no + 1}{END_COLOUR}"
47+
)
48+
49+
50+
def process_path(pathname):
51+
"""Check for doxygen commands that contain line breaks for all files a
52+
specified path.
53+
"""
54+
print(
55+
BOLD_TEXT
56+
+ f"Checking for for bad linebreaks in {pathname} . . ."
57+
+ END_COLOUR
58+
)
59+
for filename in iglob(pathname, include_hidden=True):
60+
process_file(filename)
61+
print(f"{BOLD_TEXT}Done{END_COLOUR}")
62+
63+
64+
if __name__ == "__main__":
65+
for pathname in globs:
66+
process_path(pathname)

etc/make-doc.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -e
33

44
echo "Checking whether to build the to-table . . ."
5-
if command -v pdflatex && command -v ghostscript 2>&1 >/dev/null; then
5+
if command -v pdflatex && command -v inkscape 2>&1 >/dev/null; then
66
cd docs/pictures
77
echo "Building to-table . . ."
88
pdflatex -shell-escape to-table.tex
@@ -12,6 +12,8 @@ else
1212
fi
1313
echo "Checking doc order . . ."
1414
./etc/check_doc_order.py
15+
echo "Checking doxygen linebreaks . . ."
16+
./etc/check_doxygen_line_breaks.py
1517
mkdir -p docs/build
1618
cd docs/
1719
echo "doxygen --version"

include/libsemigroups/action.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,10 @@ namespace libsemigroups {
237237
//!
238238
//! The type of the action of elements of type `Element` on points of type
239239
//! `Point`. This type should be a stateless trivially default constructible
240-
//! class with a call operator of signature `void(Point&, Point const&,
241-
//! Element const&)` which computes the action of its 3rd argument on its
242-
//! 2nd argument, and stores it in its 1st argument.
240+
//! class with a call operator of signature
241+
//! `void(Point&, Point const&, Element const&)` which computes the action
242+
//! of its 3rd argument on its 2nd argument, and stores it in its 1st
243+
//! argument.
243244
//!
244245
//! \sa ImageRightAction, ImageLeftAction
245246
using action_type = Func;
@@ -690,8 +691,8 @@ namespace libsemigroups {
690691
//!
691692
//! Returns an element \c x of the semigroup generated by the generators
692693
//! in the action such that if \c r is the root of the strongly connected
693-
//! component containing \c at(pos), then after `Func()(res, r,
694-
//! x)` the point \c res equals \c at(pos).
694+
//! component containing \c at(pos), then after
695+
//! `Func()(res, r, x)` the point \c res equals \c at(pos).
695696
//!
696697
//! \param pos a position in the action.
697698
//!

0 commit comments

Comments
 (0)