Skip to content

Commit

Permalink
docs: apply feedback and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JohelEGP committed Sep 23, 2023
1 parent 2b64931 commit 3661010
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 36 deletions.
34 changes: 28 additions & 6 deletions docs/reference/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,41 @@
cmake_minimum_required(VERSION 3.25.0)
project(mp_units_reference_documentations LANGUAGES NONE)
# The MIT License (MIT)
#
# Copyright (c) 2018 Mateusz Pusz
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

cmake_minimum_required(VERSION 3.19.0)
project(mp-units-reference-documentations LANGUAGES NONE)

include(JEGPAddStandardeseSources)

set(pdf_title "Mp-units Library")
set(pdf_title "mp-units - A Physical Quantities and Units library for C++")
set(page_license "MIT License")
set(first_library_chapter "nums")
set(last_library_chapter "qties")
# set(pdf_creator "Johel Ernesto Guerrero Pe\\~{n}a")
# set(pdf_creator "") # Defaults to "the `user.name` of Git's configuration".
# set(document_number [[\unspec]])
# set(previous_document_number [[\unspec]])
set(cover_title "Mp-units Library Reference Documentations")
set(cover_title "mp-units Library Reference Documentations")
set(reply_to "\\href{${PROJECT_HOMEPAGE_URL}/discussions}{Discussions}, \\href{${PROJECT_HOMEPAGE_URL}/issues}{issues}")
jegp_add_standardese_sources(
mp_units_reference_documentations
mp-units-reference-documentations
LIBRARIES intro numbers;quantities
EXTENSIONS macros_extensions
# CHECKED TRUE
Expand Down
2 changes: 0 additions & 2 deletions docs/reference/codeblock/.clang-format

This file was deleted.

6 changes: 3 additions & 3 deletions docs/reference/intro.tex
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@

\indexdefn{modulo}%
\definition{modulo}{def.mod}
operation performed on a set for which a division\irefiev{102-01-21} and an addition are defined,
operation performed on a set for which a division\irefiev{102-01-21} and an addition\irefiev{102-01-11} are defined,
the result of which, for elements $a$ and $b$ of the set,
is the unique element $r$, if it exists in the set,
such that $a = \lfloor a/b \rfloor b + r$
Expand Down Expand Up @@ -147,8 +147,8 @@

\begin{multicolfloattable}{mp-units library headers}{headers.mp.units}
{l}
\tcode{<mp_units/numbers.h>} \\
\tcode{<mp_units/quantity.h>} \\
\tcode{<mp-units/numbers.h>} \\
\tcode{<mp-units/quantity.h>} \\
\end{multicolfloattable}

\rSec1[spec.reqs]{Library-wide requirements}
Expand Down
2 changes: 0 additions & 2 deletions docs/reference/itemdecl/.clang-format

This file was deleted.

38 changes: 19 additions & 19 deletions docs/reference/numbers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
as summarized in \tref{nums.summary}.

\begin{libsumtab}{Numbers library summary}{nums.summary}
\ref{num.traits} & Traits & \tcode{<mp_units/numbers.h>} \\
\ref{num.traits} & Traits & \tcode{<mp-units/numbers.h>} \\
\ref{num.concepts} & Concepts & \\
\end{libsumtab}

\Sec1[nums.syn]{Header \tcode{<mp_units/numbers.h>} synopsis}
\Sec1[nums.syn]{Header \tcode{<mp-units/numbers.h>} synopsis}

\indexheader{mp_units/numbers.h}%
\indexheader{mp-units/numbers.h}%
\begin{codeblock}
namespace mp_units {

Expand Down Expand Up @@ -273,11 +273,11 @@
\topline
\lhdr{\fakegrammarterm{template-parameter-list}}
& \chdr{\fakegrammarterm{template-argument-list}}
& \rhdr{\Fundescx{Type}} \\ \rowsep
\tcode{std::integral T} & \tcode{T} & \tcode{T} \\ \rowsep
\tcode{std::floating_point T} & \tcode{T} & \tcode{T} \\ \rowsep
\tcode{class T} & \tcode{std::complex<T>} & \tcode{T} \\ \rowsep
\tcode{class T, class U} & \tcode{std::duration<T, U>} & \tcode{T} \\
& \rhdr{\Fundescx{Type}} \\ \rowsep
\tcode{std::integral T} & \tcode{T} & \tcode{T} \\ \rowsep
\tcode{std::floating_point T} & \tcode{T} & \tcode{T} \\ \rowsep
\tcode{class T} & \tcode{std::complex<T>} & \tcode{T} \\ \rowsep
\tcode{class T, class U} & \tcode{std::chrono::duration<T, U>} & \tcode{T} \\
\end{floattable}
\end{itemdescr}

Expand Down Expand Up @@ -391,14 +391,14 @@
{ l /= u } -> std::same_as<T&>;
};

export template<class T, class U> concept @\deflibconcept{modulo_with}@ =
template<class T, class U> concept @\deflibconcept{modulo_with}@ =
@\libconcept{number}@<T> &&
@\libconcept{number}@<U> &&
requires(const T& c, const U& u) {
{ c % u } -> std::common_with<T>;
};

export template<class T, class U> concept @\deflibconcept{compound_modulo_with}@ =
template<class T, class U> concept @\deflibconcept{compound_modulo_with}@ =
@\libconcept{modulo_with}@<T, U> &&
requires(T& l, const U& u) {
{ l %= u } -> std::same_as<T&>;
Expand Down Expand Up @@ -437,14 +437,14 @@

\pnum
\tcode{T} respectively models
\tcode{\exposconcept{addition-with}<U>},
\tcode{\exposconcept{compound-addition-with}<U>},
\tcode{\exposconcept{subtraction-with}<U>},
\tcode{\exposconcept{compound-subtraction-with}<U>},
\tcode{\exposconcept{multiplication-with}<U, V>},
\tcode{\exposconcept{compound-multiplication-with}<U>},
\tcode{\exposconcept{division-with}<U>},
\tcode{\exposconcept{compound-division-with}<U>},
\tcode{\exposconceptnc{addition-with}<U>},
\tcode{\exposconceptnc{compound-addition-with}<U>},
\tcode{\exposconceptnc{subtraction-with}<U>},
\tcode{\exposconceptx{com\-pound-subtraction-with}{compound-subtraction-with}<U>},
\tcode{\exposconceptnc{multiplication-with}<U, V>},
\tcode{\exposconceptnc{compound-multiplication-with}<U>},
\tcode{\exposconceptnc{division-with}<U>},
\tcode{\exposconceptnc{compound-division-with}<U>},
\tcode{\libconcept{modulo_with}<U>}, and
\tcode{\libconcept{compound_modulo_with}<U>}
only if, for each respective $E$, when the inputs to $E$ are in the domain of $E$
Expand All @@ -471,7 +471,7 @@
\end{itemdecl}

\begin{itemdecl}
export template<class T> concept @\deflibconcept{negative}@ =
template<class T> concept @\deflibconcept{negative}@ =
@\exposconcept{compound-addition-with}@<T, T> &&
requires(const T& c) {
number_zero_v<T>;
Expand Down
8 changes: 4 additions & 4 deletions docs/reference/quantities.tex
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
as summarized in \tref{qties.summary}.

\begin{modularlibsumtab}{Quantities library summary}{qties.summary}
\ref{qty.concepts} & Concepts & \tcode{<mp_units/quantity.h>} \\
\ref{qty.concepts} & Concepts & \tcode{<mp-units/quantity.h>} \\
\end{modularlibsumtab}

\Sec1[qty.syn]{Header \tcode{<mp_units/quantity.h>} synopsis}
\Sec1[qty.syn]{Header \tcode{<mp-units/quantity.h>} synopsis}

\indexheader{mp_units/quantity.h}%
\indexheader{mp-units/quantity.h}%
\indexlibraryspec{number_scalar}{quantity}%
\begin{codeblock}
#include <mp_units/numbers.h> // see \ref{nums.syn}
#include <mp-units/numbers.h> // see \ref{nums.syn}

namespace mp_units {

Expand Down

0 comments on commit 3661010

Please sign in to comment.