├── .gitignore ├── docs ├── styles │ └── style-guide.css ├── img │ ├── favicon-32.png │ ├── os_linux_note.svg │ └── dyalog-white.svg ├── images.md ├── css.md ├── print.md ├── index.md ├── tables.md ├── rules.md └── style.md ├── .gitmodules ├── requirements.txt ├── .gitattributes ├── .github ├── dependabot.yml └── workflows │ └── mkdocs-publish.yml ├── Dockerfile ├── README.md └── mkdocs.yml /.gitignore: -------------------------------------------------------------------------------- 1 | /Dyalog-icons-final 2 | /Dyalog-icons-final.zip 3 | site/ 4 | -------------------------------------------------------------------------------- /docs/styles/style-guide.css: -------------------------------------------------------------------------------- 1 | .example-output { 2 | padding: 1em; 3 | background-color: #f5f5f5 4 | } 5 | -------------------------------------------------------------------------------- /docs/img/favicon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dyalog/documentation-guidelines/trunk/docs/img/favicon-32.png -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "documentation-assets"] 2 | path = documentation-assets 3 | url = https://github.com/Dyalog/documentation-assets 4 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | mike==2.1.3 2 | mkdocs-caption 3 | mkdocs-material==9.5.39 4 | mkdocs-material-extensions 5 | markdown_tables_extended 6 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Windows line endings: diaf 2 | * text=auto eol=lf 3 | *.py text eol=lf 4 | *.md text eol=lf 5 | *.yml text eol=lf 6 | *.jpg binary 7 | *.png binary 8 | *.gif binary 9 | *.apl? linguist-language=APL -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Please see the documentation for all configuration options: 2 | # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file 3 | 4 | version: 2 5 | updates: 6 | - package-ecosystem: "gitsubmodule" # See documentation for possible values 7 | directory: "/" # Location of package manifests 8 | schedule: 9 | interval: "daily" 10 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.11-slim 2 | 3 | # Install required system dependencies 4 | RUN apt-get update && apt-get install -y \ 5 | build-essential \ 6 | git 7 | 8 | # Copy the requirements.txt file into the Docker image 9 | COPY requirements.txt . 10 | 11 | # Install Python dependencies from the requirements.txt file 12 | RUN pip install --no-cache-dir -r requirements.txt 13 | 14 | # Set the working directory (optional) 15 | WORKDIR /docs 16 | 17 | # Expose port 8000 for serving documentation 18 | EXPOSE 8000 19 | 20 | # Set ENTRYPOINT to 'mike' to allow passing arguments at runtime 21 | ENTRYPOINT ["mike"] 22 | 23 | # Default CMD as fallback if no arguments are passed 24 | CMD ["--help"] 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Documentation Guidelines 2 | Style guide and how-to for writing documentation using Material for MkDocs in Dyalog projects. 3 | 4 | ## How to Develop Docs 5 | We use Git submodules to include [centralised styles and assets](https://github.com/Dyalog/documentation-styles) to ensure consistent styles and enable updates from a single location that pervade all of our MkDocs-based documentation. 6 | 7 | To make sure you have these, use the `--recurse-submodules` flag when you clone the repository: 8 | 9 | ```console 10 | git clone git@github.com:Dyalog/documentation-guidelines.git --recurse-submodules 11 | ``` 12 | 13 | If you do a normal clone, you can still get the submodules afterwards: 14 | 15 | ```console 16 | git submodule init 17 | git submodule update 18 | ``` 19 | 20 | The build system takes a fresh checkout, so published documentation will get the latest updates from [Dyalog/documentation-styles](https://github.com/Dyalog/documentation-styles). However, when writing documentation, you might need to manually update the submodule. 21 | 22 | ```console 23 | git submodule update 24 | ``` 25 | -------------------------------------------------------------------------------- /docs/images.md: -------------------------------------------------------------------------------- 1 | # Figures with Captions 2 | 3 | !!! Info "Information" 4 | We use the [caption](https://github.com/tobiasah/mkdocs-caption#readme) plugin to automatically number and cross-reference figures and tables in Material for MkDocs. 5 | 6 | The Markdown way to add an image is a Markdown link preceded by an exclamation mark: 7 | 8 | ```other 9 |  10 | ``` 11 | 12 | By using the [attribute list](https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown/#attribute-lists) syntax we can add CSS classes, id, attributes etc, without resorting to HTML. 13 | 14 | ```other 15 | { width=300px #MyImgId } 16 | ``` 17 | 18 | Here is an example: 19 | 20 | ```other 21 | { width=300px #MyElephant} 22 | ``` 23 | 24 | { width=300px #MyElephant} 25 | 26 | Like with [tables](tables.md), we reference the image by its id by an "empty" link: 27 | 28 | ``` 29 | The beautiful specimen in [](#MyElephant) is a bull with the name of Kevin. 30 | ``` 31 | 32 | The beautiful specimen in [](#MyElephant) is a bull with the name of Kevin. -------------------------------------------------------------------------------- /mkdocs.yml: -------------------------------------------------------------------------------- 1 | site_name: Dyalog Documentation Guidelines 2 | repo_url: https://github.com/Dyalog/documentation-guidelines 3 | 4 | copyright: Copyright © 2015-2025 Dyalog, LTD 5 | theme: 6 | name: material 7 | favicon: documentation-assets/images/favicon-32.png 8 | language: en 9 | logo: documentation-assets/images/dyalog-logo_white.svg 10 | plugins: 11 | - caption: 12 | table: 13 | enable: true 14 | start_index: 1 15 | increment_index: 1 16 | position: bottom 17 | markdown_extensions: 18 | - admonition 19 | - pymdownx.highlight: 20 | use_pygments: false 21 | - md_in_html 22 | - pymdownx.details 23 | - pymdownx.superfences 24 | - attr_list 25 | - pymdownx.emoji: 26 | emoji_index: !!python/name:material.extensions.emoji.twemoji 27 | emoji_generator: !!python/name:material.extensions.emoji.to_svg 28 | - markdown_tables_extended 29 | - toc: 30 | title: On this page 31 | extra_css: 32 | - documentation-assets/css/main.css 33 | - documentation-assets/css/extra.css 34 | - styles/style-guide.css 35 | nav: 36 | - Home: index.md 37 | - Rules for Writing Documentation: rules.md 38 | - Style Guide: style.md 39 | - Images: images.md 40 | - Tables: tables.md 41 | - CSS: css.md 42 | -------------------------------------------------------------------------------- /docs/css.md: -------------------------------------------------------------------------------- 1 | # CSS 2 | 3 | CSS, or [Cascading Style Sheets](https://en.wikipedia.org/wiki/CSS), define the presentation layer of a website. Our aim at Dyalog is that as a documentation contributor, you should not need to get your hands dirty at this level. Moreover, any CSS changes need to be discussed as a wider group, as there are more aspects (beyond MkDocs) to the documentation build pipeline that rely on the CSS, like the CHM and PDF versions of the documentation. CSS that you write is not automatically picked up (paged media CSS is very different). 4 | 5 | ## Dyalog MkDocs CSS 6 | 7 | The CSS defining the Dyalog-specific customisations are found in the locations specified in the `mkdocs.yml` file. Typically, that means `docs/style`. In there, you'll see two files of interest: 8 | 9 | 1. **main.css** 10 | 2. **extra.css** 11 | 12 | These are not mandated by MkDocs, but any CSS files found in the directories specified in the `mkdocs.yml` file will be included. Note, however, that there is a lot more CSS injected as part of the rendering pipeline, specific to the [MkDocs Material](https://github.com/squidfunk/mkdocs-material) theme, defining things like navigation panels etc. There _are_ ways to hook into that, but this is not something we should encourage. 13 | 14 | As a "run of the mill" documentation contributor, you should rarely need to consider the CSS. -------------------------------------------------------------------------------- /docs/print.md: -------------------------------------------------------------------------------- 1 | # Making Documents Work for Print 2 | Some experimentation has been done to produce usable PDFs, primarily for the purpose of printing documentation to paper. 3 | 4 | [Dyalog/RP-Jenkins-Test]() produces the Link User Guide as a PDF ([dyalog.github.io/RP-Jenkins-Test/3.7/Link%20User%20Guide.pdf](https://dyalog.github.io/RP-Jenkins-Test/3.7/Link%20User%20Guide.pdf)). 5 | 6 | The HttpCommand documentation has a [print page (dyalog.github.io/HttpCommand/5.3/print_page)](https://dyalog.github.io/HttpCommand/5.3/print_page/) which simply puts the entire site content in a single HTML document which can be printed in the browser's **File → Print** menu item. 7 | 8 | ## Cross referencing 9 | References which are inline as part of prose do not work when printed. 10 | 11 | The [with-pdf](https://github.com/orzih/mkdocs-with-pdf) plugin adds section numbers, but we need to see if it is possible to have automatic referencing. 12 | 13 | ## Extra styles 14 | 15 | ### keepTogether 16 | A class should be created which can be used to wrap elements which should not be split across pages in a printed document. 17 | 18 | ```css 19 | .keepTogether { page-break-inside: avoid; } 20 | ``` 21 | 22 | ### keepWithNext 23 | apply to text that must be kept with the following element 24 | 25 | ### pageBreakBefore 26 | apply to text that should be at the top of a page 27 | 28 | ## Figures and tables 29 | - can we refer to an image/figure/table using anchor tags? can figures be numbered automatically? 30 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # Dyalog Documentation Style Guide 2 | 3 | ## To Do 4 | - references in HTML vs. PDF 5 | - consider linking to specific document versions in references to other documents 6 | 7 | ## Markdown and HTML 8 | This document, and the documentation to which it refers, is written in Markdown. 9 | 10 | Markdown is a markup language for formatting text documents. It is designed to be simple and legible even in raw form. For example, compare 11 | 12 | ```markdown 13 | # My Heading 14 | This is some **bold** text with [a link](#). 15 | ``` 16 | 17 | and 18 | 19 | ```HTML 20 |
48 | Table: Cells with content { #MyTable }
49 |
50 | | heading 1 | heading 2 |
51 | | --------- | --------- |
52 | | content 1 | content 2 |
53 | | content 3 | content 4 |
54 |
55 |
56 | which should render as:
57 |
58 | Table: Cells with content { #MyTable }
59 |
60 | | heading 1 | heading 2 |
61 | | --------- | --------- |
62 | | content 1 | content 2 |
63 | | content 3 | content 4 |
64 |
65 | You, the author, are responsible for choosing a unique table id (the `#MyTable` in this case) which is unique and appropriate for the table.
66 |
67 | To reference a table based on its id, insert a Markdown link to the id, with an empty anchor:
68 |
69 | 70 | As shown in [](#MyTable), yadda yadda. 71 |72 | 73 | where the anchor text should be filled in by the extension: 74 | 75 | As shown in [](#MyTable), yadda yadda. -------------------------------------------------------------------------------- /.github/workflows/mkdocs-publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish MkDocs Documentation 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | version: 7 | description: 'Version to deploy (e.g. 20.0)' 8 | required: true 9 | default: '20.0' 10 | type: string 11 | update_latest: 12 | description: 'Update this as latest version?' 13 | required: true 14 | default: true 15 | type: boolean 16 | 17 | permissions: 18 | contents: write 19 | pages: write 20 | 21 | jobs: 22 | deploy: 23 | runs-on: ubuntu-latest 24 | 25 | steps: 26 | - uses: actions/checkout@v4 27 | with: 28 | submodules: recursive 29 | fetch-depth: 0 # Required for mike to work properly 30 | - name: Update Assets 31 | run: git submodule update --remote --recursive documentation-assets 32 | - name: Set up Python 33 | uses: actions/setup-python@v5 34 | with: 35 | python-version: '3.11' 36 | 37 | - name: Set up Git 38 | run: | 39 | git config --global user.name "github-actions[bot]" 40 | git config --global user.email "github-actions[bot]@users.noreply.github.com" 41 | 42 | - name: Install dependencies 43 | run: | 44 | python -m pip install --upgrade pip 45 | pip install \ 46 | mike \ 47 | mkdocs-material \ 48 | mkdocs-macros-plugin \ 49 | mkdocs-monorepo-plugin \ 50 | mkdocs-site-urls \ 51 | mkdocs-caption \ 52 | markdown-tables-extended 53 | 54 | - name: Get Git Info 55 | id: git-info 56 | run: | 57 | BRANCH=$(git rev-parse --abbrev-ref HEAD) 58 | HASH=$(git rev-parse --short HEAD) 59 | echo "GIT_INFO=${BRANCH}:${HASH}" >> $GITHUB_OUTPUT 60 | echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT 61 | echo "CURRENT_YEAR=$(date +'%Y')" >> $GITHUB_OUTPUT 62 | 63 | - name: Substitute env variables in mkdocs.yml 64 | env: 65 | GIT_INFO: ${{ steps.git-info.outputs.GIT_INFO }} 66 | BUILD_DATE: ${{ steps.git-info.outputs.DATE }} 67 | CURRENT_YEAR: ${{ steps.git-info.outputs.CURRENT_YEAR }} 68 | run: | 69 | # Create backup 70 | cp mkdocs.yml mkdocs.yml.bak 71 | # Substitute variables 72 | envsubst '$BUILD_DATE $GIT_INFO $CURRENT_YEAR' < mkdocs.yml.bak > mkdocs.yml 73 | # Display substituted content for debugging 74 | echo "--- Checking substituted content ---" 75 | cat mkdocs.yml | grep -A5 copyright 76 | 77 | - name: Move Assets into docs 78 | run: | 79 | mv documentation-assets docs 80 | 81 | - name: Deploy documentation 82 | run: | 83 | mike deploy --push ${{ inputs.version }} 84 | if [ "${{ inputs.update_latest }}" = "true" ]; then 85 | mike deploy --push --update-aliases ${{ inputs.version }} latest 86 | fi 87 | -------------------------------------------------------------------------------- /docs/img/os_linux_note.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 112 | -------------------------------------------------------------------------------- /docs/rules.md: -------------------------------------------------------------------------------- 1 | # Rules for Writing Documentation 2 | 3 | ## Language 4 | 5 | The documentation uses U.K. English for spellings and grammar. 6 | 7 | Abbreviations should not be used (for example, shouldn't, can't, won't) and neither should emoticons. 8 | 9 | Although the documents are not currently translated, they should be written as if they could be. That means consideration of the language used...can it be understood and translated unambiguously? For example, "configure" should be used rather than "set up" as "set up" can be misunderstood. This might sound silly, but translation is not always done in context, and people can put single words into Google Translate (for example) and get random results! Idioms, colloquialisms, and foreign expressions (including Latin) should also be avoided. 10 | 11 | Language style will vary between documents. For example, the Language Reference Guide needs to be very precise and official whereas a User Guide can include less formal statements such as "You might notice that...". 12 | 13 | Do **not** use an apostrophe when pluralising an acronym ("CPU's today are..." = WRONG) 14 | 15 | Try to make documents future-proof (especially with respect to dates/version numbers, "coming soon", and so on). Variables can help with this! 16 | 17 | ## Terminology 18 | 19 | The following table lists correct terminology and terms to avoid. A complete list of the [approved names for glyphs and primitive functions/operators](https://docs.dyalog.com/latest/CheatSheet%20-%20Nomenclature%20-%20Functions%20and%20Operators.pdf) is also available. 20 | 21 | **NOTE:** Although these terms are the correct ones to use, the documentation must always reflect the software. For example, if a field in the software uses "pdf" then the documentation should also use "pdf" when referring to that field content; the software usage always takes precedence. 22 | 23 | |**Use**|**Avoid**| 24 | |---|---| 25 | |large-span file|64-bit file| 26 | |small-span file|32-bit file| 27 | |Dyalog (referring to the product)|Dyalog APL| 28 | |Dyalog Ltd (referring to the company)|Dyalog| 29 | |PDF|pdf| 30 | |.NET|.Net, .net, any other variation| 31 | |dfn (Dfn when starting a sentence)|d-fn, D-fn, Dfn (unless starting a sentence), etc.| 32 | |Trace Window|Tracer, Debugger| 33 | |Edit Window|Editor| 34 | |for example|eg, e.g., eg.| 35 | |that is|ie, i.e., ie.| 36 | |note|NB, N.B.| 37 | |Boolean|boolean| 38 | |UNIX|Unix, unix| 39 | |configuration parameter|environment variable| 40 | 41 | 42 | Best practice: 43 | 44 | |**Use**|**Avoid**| 45 | |---|---| 46 | |can, might|may| 47 | |want|wish| 48 | 49 | ## Dyalog-specific Terms 50 | 51 | "Dyalog": 52 | 53 | - Dyalog = the product 54 | - Dyalog APL = the language 55 | - Dyalog Ltd = the company 56 | 57 | Syntax: 58 | 59 | - System functions should be written in upper case, for example, ⎕OFF 60 | - System commands should be written in upper case, for example, )CLEAR 61 | - User commands should be written in upper camel case, with user command groups wtirren in upper case, for example, ]LINK.GetItemName 62 | - Configuration parameters should be written in upper case if cross-platform; some of them are written in mixed case on Microsoft Windows, although this not case sensitive so upper case works there too. See the appropriate _Dyalog for `
Example
135 | 136 | ``` 137 |138 | Markdown renders in here. For example, *italicised text*. 139 |
140 | ``` 141 | 142 |144 | Markdown renders in here. For example, *italicised text*. 145 |
146 |example
185 | 186 | ``` 187 | !!! Info "Information" 188 | The .NET interface only works with the Unicode edition of Dyalog; Classic edition is not supported. 189 | ``` 190 | 191 |example
203 | 204 | ``` 205 | !!! Warning "Warning" 206 | The structure under the SALT directory must not be modified and the five sub-directories must not be renamed. 207 | ``` 208 | 209 |example
221 | 222 | ``` 223 | !!! Legacy "Legacy" 224 | Although .dyapp files are supported for backwards compatibility, Dyalog Ltd recommends launching the interpreter directly from any APL source or configuration file (functionality introduced with Dyalog version 18.0) rather than through the now-superseded .dyapp file mechanism. 225 | ``` 226 | 227 |example
242 | 243 | ``` 244 | !!! linux "Dyalog on Linux" 245 | The MyUCMDs directory is located directly under the **$HOME** directory 246 | ``` 247 | 248 |example
260 | 261 | ``` 262 | !!! unix "Dyalog on UNIX" 263 | By default, the cache file is located in **$HOME/.dyalog/** 264 | ``` 265 | 266 |example
278 | 279 | ``` 280 | !!! macos "Dyalog on macOS" 281 | By default, the cache file is located in **Users/example
296 | 297 | ``` 298 | !!! windows "Dyalog on Microsoft Windows" 299 | By default, the cache file is located in **Documents\\Dyalog APL[your code here]` or single backticks `` `[your code here]` ``.
372 |
373 | Example: APL code
374 | 375 | ```html 376 | The average of a vector (`+⌿÷≢`) is the sum divided by the tally. 377 | ``` 378 | 379 |Example: non-APL code
386 | 387 | ```html 388 |getpid() is common to all UNIX platforms.
389 | ```
390 |
391 | getpid() is common to all UNIX platforms.
394 |
395 | Example: Using backticks
407 | 408 | ``````` 409 | ```apl 410 | 3+⍳10 411 | 4 5 6 7 8 9 10 11 12 13 412 | ``` 413 | ``````` 414 | 415 | ```apl 416 | 3+⍳10 417 | 4 5 6 7 8 9 10 11 12 13 418 | ``` 419 | 420 | #### Non-APL Code Blocks 421 | Use triple backticks with "nonAPL". 422 | 423 |Example: Using backticks
424 | 425 | `````` 426 | ```nonAPL 427 | >>> print("hello") # Code block example 428 | hello 429 | ``` 430 | `````` 431 | 432 | ```nonAPL 433 | >>> print("hello") # Code block example 434 | hello 435 | ``` 436 | 437 | ### APL Code +⌿÷≢⌹ in Titles 438 | Try to avoid using APL code in headings – although it is rendered in APL font on the page, it is not rendered correctly in the navigation menus. 439 | 440 | If it is essential, use `` to add code to titles. 441 | 442 |Example
443 | 444 | ```markdown 445 | ### APL Code +⌿÷≢⌹ in Titles 446 | ``` 447 | 448 | ## References 449 | Always use meaningful link text. Never use "see [here](#)". 450 | 451 | ### Within the same document 452 | Reference to another section within the same document. 453 | 454 | ``` 455 | See [Note Types](#note-types) 456 | ``` 457 | 458 |Example
466 | 467 | ``` 468 | For more information on the _Clean_ function, see the [_SALT User Guide_](https://docs.dyalog.com/latest/SALT%20User%20Guide.pdf). 469 | ``` 470 | 471 |Example
519 | 520 | ``` 521 | Use :material-apple-keyboard-command: + C to copy text 522 | ``` 523 | 524 |