Skip to content
Snippets Groups Projects
Verified Commit 3a7ba130 authored by Romain Deville's avatar Romain Deville
Browse files

:twisted_rightwards_arrows: release-0.0.0 into master

First release of mkdocs_template to allow testing of scripts, base
mkdocs template installation and CI.
parents 0be4afd9 07fcfad2
No related branches found
No related tags found
No related merge requests found
Showing
with 3429 additions and 0 deletions
# Config is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style for every file
[*]
# Set default charset
charset = utf-8
end_of_line = lf
# Do not insert final new line at the end of file
insert_final_newline = false
# Automatically remove trailing space at end of line
trim_trailing_whitespace = true
# Size of indentation (either tabs or space)
indent_size = 2
# Python specific syntax
[*.py]
# Type of indentation (either tabs or space)
indent_style = space
# Size of indentation (either tabs or space)
indent_size = 4
# Maximum length (in number of chars) for a line
max_line_length = 80
# Yaml specific syntax
[*.{yaml,yml}]
# Type of indentation (either tabs or space)
indent_style = space
# Size of indentation (either tabs or space)
indent_size = 2
# Maximum length (in number of chars) for a line
max_line_length = 120
# Project Specific Gitignore
.vimrc.local
.tmuxinator.yml
.old/
.tmp/
### BEGIN MKDOCS TEMPLATE ###
### WARNING, DO NOT UPDATE CONTENT BETWEEN MKDOCS TEMPLATE TAG ! ###
### Modified content will be overwritten when updating. ###
# Created by https://www.toptal.com/developers/gitignore/api/linux,ansible,macos,windows,python,direnv,archive,archives,backup,emacs,vim,code,hugo,latex,nohup,ssh,tags,test,vagrant,virtualenv,zsh,dotenv,venv
# Edit at https://www.toptal.com/developers/gitignore?templates=linux,ansible,macos,windows,python,direnv,archive,archives,backup,emacs,vim,code,hugo,latex,nohup,ssh,tags,test,vagrant,virtualenv,zsh,dotenv,venv
### Ansible ###
*.retry
### Archive ###
### Mostly from https://en.wikipedia.org/wiki/List_of_archive_formats
## Archiving only
# The traditional archive format on Unix-like systems, now used mainly for the
# creation of static libraries.
*.a
*.ar
# RPM files consist of metadata concatenated with (usually) a cpio archive.
# Newer RPM systems also support other archives, as cpio is becoming obsolete.
# cpio is also used with initramfs.
*.cpio
# A self-extracting archive that uses the Bourne shell (sh).
*.shar
# A system for storing multiple files. LBR archives typically contained files
# processed by SQ, or the archive itself was compressed with SQ. LBR archives
# that were compressed with SQ ended with the extension .LQR
*.LBR
# An archive format originally used mainly for archiving and distribution of
# the exact, nearly-exact, or custom-modified contents of an optical storage
# medium such as a CD-ROM or DVD-ROM. However, it can be used to archive the
# contents of other storage media, selected partitions, folders, and/or files.
# The resulting archive is typically optimized for convenient rendering to
# (re-)writable CD or DVD media.
*.iso
# A library format used primarily on the Commodore 64 and 128 lines of
# computers. This bears no resemblance to the DOS LBR format. While library files
# were quick to implement (a number of programs exist to work with them) they are
# crippled in that they cannot grow with use: once a file has been created it
# cannot be amended (files added, changed or deleted) without recreating the
# entire file.
*.lbr
# An archive format used by Mozilla for storing binary diffs. Used in
# conjunction with bzip2.
*.mar
# A common archive format used on Unix-like systems. Generally used in
# conjunction with compressors such as gzip, bzip2, compress or xz to create
# .tar.gz, .tar.bz2, .tar.Z or tar.xz files.
*.tar
# Package managers
# Red Hat Package Manager
*.rpm
# Debian package
*.deb
# MicroSoft Installer
*.msi
*.msm
*.msp
# Mozilla package installer
*.xpi
# Ruby Package
*.gem
### Archives ###
# It's better to unpack these files and commit the raw source because
# git has its own built in compression methods.
*.7z
*.jar
*.rar
*.zip
*.gz
*.gzip
*.tgz
*.bzip
*.bzip2
*.bz2
*.xz
*.lzma
*.cab
*.xar
# Packing-only formats
# Package management formats
*.dmg
*.egg
*.txz
### Backup ###
*.bak
*.gho
*.ori
*.orig
*.tmp
### Code ###
.vscode/*
!.vscode/tasks.json
!.vscode/launch.json
*.code-workspace
### direnv ###
.direnv
.envrc
.envrc.ini
### dotenv ###
.env
### Emacs ###
# -*- mode: gitignore; -*-
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*
# Org-mode
.org-id-locations
*_archive
ltximg/**
# flymake-mode
*_flymake.*
# eshell files
/eshell/history
/eshell/lastdir
# elpa packages
/elpa/
# reftex files
*.rel
# AUCTeX auto folder
/auto/
# cask packages
.cask/
dist/
# Flycheck
flycheck_*.el
# server auth directory
/server/
# projectiles files
.projectile
# directory configuration
.dir-locals.el
# network security
/network-security.data
### Hugo ###
# Generated files by hugo
/public/
/resources/_gen/
hugo_stats.json
# Executable may be added to repository
hugo.exe
hugo.darwin
hugo.linux
### LaTeX ###
## Core latex/pdflatex auxiliary files:
*.aux
*.lof
*.log
*.lot
*.fls
*.out
*.toc
*.fmt
*.fot
*.cb
*.cb2
.*.lb
## Intermediate documents:
*.dvi
*.xdv
*-converted-to.*
# these rules might exclude image files for figures etc.
# *.ps
# *.eps
# *.pdf
## Generated if empty string is given at "Please type another file name for output:"
.pdf
## Bibliography auxiliary files (bibtex/biblatex/biber):
*.bbl
*.bcf
*.blg
*-blx.aux
*-blx.bib
*.run.xml
## Build tool auxiliary files:
*.fdb_latexmk
*.synctex
*.synctex(busy)
*.synctex.gz
*.synctex.gz(busy)
*.pdfsync
## Build tool directories for auxiliary files
# latexrun
latex.out/
## Auxiliary and intermediate files from other packages:
# algorithms
*.alg
*.loa
# achemso
acs-*.bib
# amsthm
*.thm
# beamer
*.nav
*.pre
*.snm
*.vrb
# changes
*.soc
# comment
*.cut
# cprotect
*.cpt
# elsarticle (documentclass of Elsevier journals)
*.spl
# endnotes
*.ent
# fixme
*.lox
# feynmf/feynmp
*.mf
*.mp
*.t[1-9]
*.t[1-9][0-9]
*.tfm
#(r)(e)ledmac/(r)(e)ledpar
*.end
*.?end
*.[1-9]
*.[1-9][0-9]
*.[1-9][0-9][0-9]
*.[1-9]R
*.[1-9][0-9]R
*.[1-9][0-9][0-9]R
*.eledsec[1-9]
*.eledsec[1-9]R
*.eledsec[1-9][0-9]
*.eledsec[1-9][0-9]R
*.eledsec[1-9][0-9][0-9]
*.eledsec[1-9][0-9][0-9]R
# glossaries
*.acn
*.acr
*.glg
*.glo
*.gls
*.*-glg
*.*-glo
*.*-gls
*.glsdefs
*.lzo
*.lzs
# uncomment this for glossaries-extra (will ignore makeindex's style files!)
# *.ist
# gnuplottex
*-gnuplottex-*
# gregoriotex
*.gaux
*.gtex
# htlatex
*.4ct
*.4tc
*.idv
*.lg
*.trc
*.xref
# hyperref
*.brf
# knitr
*-concordance.tex
# TODO Comment the next line if you want to keep your tikz graphics files
*.tikz
*-tikzDictionary
# listings
*.lol
# luatexja-ruby
*.ltjruby
# makeidx
*.idx
*.ilg
*.ind
# minitoc
*.maf
*.mlf
*.mlt
*.mtc
*.mtc[0-9]*
*.slf[0-9]*
*.slt[0-9]*
*.stc[0-9]*
# minted
_minted*
*.pyg
# morewrites
*.mw
# nomencl
*.nlg
*.nlo
*.nls
# pax
*.pax
# pdfpcnotes
*.pdfpc
# sagetex
*.sagetex.sage
*.sagetex.py
*.sagetex.scmd
# scrwfile
*.wrt
# sympy
*.sout
*.sympy
sympy-plots-for-*.tex/
# pdfcomment
*.upa
*.upb
# pythontex
*.pytxcode
pythontex-files-*/
# tcolorbox
*.listing
# thmtools
*.loe
# TikZ & PGF
*.dpth
*.md5
*.auxlock
# todonotes
*.tdo
# vhistory
*.hst
*.ver
# easy-todo
*.lod
# xcolor
*.xcp
# xmpincl
*.xmpi
# xindy
*.xdy
# xypic precompiled matrices and outlines
*.xyc
*.xyd
# endfloat
*.ttt
*.fff
# Latexian
TSWLatexianTemp*
## Editors:
# WinEdt
*.sav
# Texpad
.texpadtmp
# LyX
*.lyx~
# Kile
*.backup
# gummi
.*.swp
# KBibTeX
*~[0-9]*
# TeXnicCenter
*.tps
# auto folder when using emacs and auctex
./auto/*
*.el
# expex forward references with \gathertags
*-tags.tex
# standalone packages
*.sta
# Makeindex log files
*.lpz
# REVTeX puts footnotes in the bibliography by default, unless the nofootinbib
# option is specified. Footnotes are the stored in a file with suffix Notes.bib.
# Uncomment the next line to have this generated file ignored.
#*Notes.bib
### LaTeX Patch ###
# LIPIcs / OASIcs
*.vtc
# glossaries
*.glstex
### Linux ###
# temporary files which can be created if a process still has a handle open of
# a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Nohup ###
nohup.out
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
downloads/
eggs/
.eggs/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
pytestdebug.log
# Translations
*.mo
*.pot
# Django stuff:
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
doc/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in
# version control. However, in case of collaboration, if having
# platform-specific dependencies or dependencies having no cross-platform
# support, pipenv may install dependencies that don't work, or not install
# all needed dependencies.
#Pipfile.lock
# poetry
#poetry.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
# .env
.env/
.venv/
env/
venv/
ENV/
env.bak/
venv.bak/
pythonenv*
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# operating system-related files
# file properties cache/storage on macOS
*.DS_Store
# thumbnail cache on Windows
Thumbs.db
# profiling data
.prof
### SSH ###
**/.ssh/id_*
**/.ssh/*_id_*
**/.ssh/known_hosts
### Tags ###
# Ignore tags created by etags, ctags, gtags (GNU global) and cscope
TAGS
.TAGS
!TAGS/
tags
.tags
!tags/
gtags.files
GTAGS
GRTAGS
GPATH
GSYMS
cscope.files
cscope.out
cscope.in.out
cscope.po.out
### Test ###
### Ignore all files that could be used to test your code and
### you wouldn't want to push
# Reference https://en.wikipedia.org/wiki/Metasyntactic_variable
# Most common
*foo
*bar
*fubar
*foobar
*baz
# Less common
*qux
*quux
*bongo
*bazola
*ztesch
# UK, Australia
*wibble
*wobble
*wubble
*flob
*blep
*blah
*boop
*beep
# Japanese
*hoge
*piyo
*fuga
*hogera
*hogehoge
# Portugal, Spain
*fulano
*sicrano
*beltrano
*mengano
*perengano
*zutano
# France, Italy, the Netherlands
*toto
*titi
*tata
*tutu
*pipppo
*pluto
*paperino
*aap
*noot
*mies
# Other names that would make sense
*tests
*testsdir
*testsfile
*testsfiles
*test
*testdir
*testfile
*testfiles
*testing
*testingdir
*testingfile
*testingfiles
*temp
*tempdir
*tempfile
*tempfiles
*tmp
*tmpdir
*tmpfile
*tmpfiles
*lol
### Vagrant ###
# General
.vagrant/
# Log files (if you are creating logs in debug mode, uncomment this)
# *.log
### Vagrant Patch ###
*.box
### venv ###
# Virtualenv
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
[Bb]in
[Ii]nclude
[Ll]ib
[Ll]ib64
[Ll]ocal
[Ss]cripts
pyvenv.cfg
.venv
pip-selfcheck.json
### Vim ###
# Swap
[._]*.s[a-v][a-z]
!*.svg # comment out if you don't need vector files
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
# Session
Session.vim
Sessionx.vim
# Temporary
.netrwhist
# Auto-generated tag files
# Persistent undo
[._]*.un~
### VirtualEnv ###
# Virtualenv
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
### Windows ###
# Windows thumbnail cache files
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.msix
# Windows shortcuts
*.lnk
### Zsh ###
# Zsh compiled script + zrecompile backup
*.zwc
*.zwc.old
# Zsh completion-optimization dumpfile
*zcompdump*
# Zsh zcalc history
.zcalc_history
# A popular plugin manager's files
._zinit
.zinit_lstupd
# zdharma/zshelldoc tool's files
zsdoc/data
# robbyrussell/oh-my-zsh/plugins/per-directory-history plugin's files
# (when set-up to store the history in the local directory)
.directory_history
# MichaelAquilina/zsh-autoswitch-virtualenv plugin's files
# (for Zsh plugins using Python)
# Zunit tests' output
/tests/_output/*
!/tests/_output/.gitkeep
# End of https://www.toptal.com/developers/gitignore/api/linux,ansible,macos,windows,python,direnv,archive,archives,backup,emacs,vim,code,hugo,latex,nohup,ssh,tags,test,vagrant,virtualenv,zsh,dotenv,venv
### END MKDOCS TEMPLATE ###
# ******************************************************************************
# VIM MODELINE
# vim: ft=gitignore
# ******************************************************************************
---
# GLOBAL CONFIGURATION
# =============================================================================
# YAML Anchors
# -----------------------------------------------------------------------------
# This CI file haevily make use of YAML anchors for multiple reasons:
# - Avoid writing twice the same block of codes
# - Resuse block of codes
# - Make the CI more generic and easily extensible or modifiable
# See https://docs.gitlab.com/ee/ci/yaml/README.html#anchors
# Define base workflow
# https://docs.gitlab.com/ee/ci/yaml/README.html#workflow
workflow:
rules:
# Do not run CI when commit title have
# WIP, NO-CI or 🚧 (gitmoji for "work in progress", aka :construction:)
- if: |
$CI_COMMIT_TITLE =~ /.*WIP.*/ ||
$CI_COMMIT_TITLE =~ /.*NO-CI.*/ ||
$CI_COMMIT_TITLE =~ /.*🚧.*/
when: never
# Run the CI otherwise (depending on `only/except` key per jobs)
- when: always
### BEGIN MKDOCS TEMPLATE ###
### WARNING, DO NOT UPDATE CONTENT BETWEEN MKDOCS TEMPLATE TAG ! ###
### Modified content will be overwritten when updating. ###
# Include other gitlab-ci.yml files
include:
- local: docs/.gitlab-ci.yml
### END MKDOCS TEMPLATE ###
# Stages jobs will pass through with anchors to avoid updating stage in multiple
# place within this file. Now renaming a stage can be done directly after the
# anchor name below.
# https://docs.gitlab.com/ee/ci/yaml/README.html#stage
stages:
- &pre_test pre_test
- &test test
- &build build
- &deploy deploy
- &post_deploy post_deploy
# Global variables shared for all jobs
# https://docs.gitlab.com/ee/ci/yaml/README.html#variables
variables:
PIP_CACHE_DIR: "${CI_PROJECT_DIR}/.cache/pip"
# Images anchors
# -----------------------------------------------------------------------------
# https://docs.gitlab.com/ee/ci/yaml/README.html#image
# Basic docker image -> docker:latest image
.image_docker: &image_docker
image: docker:latest
# Before scripts anchors
# -----------------------------------------------------------------------------
# https://docs.gitlab.com/ee/ci/yaml/README.html#before_script
.before_script_python_dependencies: &before_script_python_dependencies
before_script:
# Add python dependencies
- apk update
# Install base package required for mkdocs builds
- apk add --no-cache --update-cache
build-base
python3-dev
py3-pip
py3-virtualenv
bash
git
gcc
# Create virtual environment
- virtualenv .venv
# Activate virtual environment
- source .venv/bin/activate
# Only anchors
# -----------------------------------------------------------------------------
# https://docs.gitlab.com/ee/ci/yaml/README.html#only
# List all names of refs that can be used with key (only|except):refs using
# anchors to avoid having to modify multiple times. Refs are:
# - Branches names based on git flow: https://danielkummer.github.io/git-flow-cheatsheet/
# - merge_requests (https://docs.gitlab.com/ee/ci/yaml/README.html#onlyexcept-basic)
# - tags (https://docs.gitlab.com/ee/ci/yaml/README.html#onlyexcept-basic)
.refs_names:
- &ref_release /release-*/
- &ref_feature /feature-*/
- &ref_hotfix /hotfix-*/
- &ref_bugfix /bugfix-*/
- &ref_develop develop
- &ref_master master
- &ref_merge_requests merge_requests
- &ref_tags tags
# Specify on which branch, tags or on merge_requests CI should be done.
# Jobs under only_dev anchor will be run if branch name are compliant with git
# flow branch which are not `develop` neither `master` and will be run on
# merge_request
.only_dev: &only_dev
only:
refs:
- *ref_release
- *ref_feature
- *ref_hotfix
- *ref_bugfix
- *ref_merge_requests
# Jobs under only_pre_prod anchor will be run on `develop` (i.e. pre-release)
# and `master` (release) branch.
.only_pre_prod: &only_pre_prod
only:
refs:
- *ref_develop
- *ref_master
# Jobs under only_prod anchor will be run on tagged commit.
.only_prod: &only_prod
only:
refs:
- *ref_tags
# Jobs under only_trigger anchor will be run on `develop` (i.e. pre-release)
# `master` (release) branch and tagged commit.
.only_trigger: &only_trigger
only:
refs:
- *ref_develop
- *ref_master
- *ref_tags
# Tag anchors
# -----------------------------------------------------------------------------
# https://docs.gitlab.com/ee/ci/yaml/README.html#tag
# Run jobs in regular docker
.tag_docker: &tag_docker
tags:
- docker
# Stages anchors
# -----------------------------------------------------------------------------
# https://docs.gitlab.com/ee/ci/yaml/README.html#stage
# This can be seen as overbloated while overuse of YAML anchors, but the
# advantage is that if we rename a stage, we will just need to rename it at the
# start of this CI.
.stage_pre_test: &stage_pre_test
stage: *pre_test
.stage_test: &stage_test
stage: *test
.stage_build: &stage_build
stage: *build
.stage_deploy: &stage_deploy
stage: *deploy
.stage_post_deploy: &stage_post_deploy
stage: *post_deploy
# =============================================================================
# CI JOBS
# =============================================================================
# Jobs in test stage
# -----------------------------------------------------------------------------
test_tox_format_python:
<<: *tag_docker
<<: *image_docker
<<: *stage_test
<<: *before_script_python_dependencies
script:
# Install python tox
- pip3 install tox
# Run tox
- tox -e format_python
test_tox_format_shell:
<<: *tag_docker
<<: *image_docker
<<: *stage_test
<<: *before_script_python_dependencies
script:
# Install python tox
- pip3 install tox
# Run tox
- tox -e format_shell
# *****************************************************************************
# VIM MODELINE
# vim: fdm=indent
# *****************************************************************************
---
# Based on ansible-lint config
extends: default
ignore: |
.*
rules:
braces:
max-spaces-inside: 1
level: error
brackets:
max-spaces-inside: 1
level: error
colons:
max-spaces-after: -1
level: error
commas:
max-spaces-after: -1
level: error
comments: disable
comments-indentation: disable
document-start: disable
empty-lines:
max: 3
level: error
hyphens:
level: error
indentation: disable
key-duplicates: enable
line-length: disable
new-line-at-end-of-file: disable
new-lines:
type: unix
trailing-spaces: disable
truthy: disable
# *****************************************************************************
# VIM MODELINE
# vim: ft=yaml: fdm=indent:
# *****************************************************************************
"THE BEER-WARE LICENSE" (Revision 42):
Romain Deville <code@romaindeville.fr> wrote this project.
As long as you retain this notice you can do whatever you want with this stuff.
If we meet some day, and you think this stuff is worth it, you can buy me a
beer in return.
<!-- BEGIN MKDOCS TEMPLATE -->
<!--
WARNING, DO NOT UPDATE CONTENT BETWEEN MKDOCS TEMPLATE TAG !
Modified content will be overwritten when updating
-->
<!-- END MKDOCS TEMPLATE -->
\ No newline at end of file
MIT License
Copyright (c) 2020 Romain Deville <code@romaindeville.fr>
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.
<!-- BEGIN MKDOCS TEMPLATE -->
<!--
WARNING, DO NOT UPDATE CONTENT BETWEEN MKDOCS TEMPLATE TAG !
Modified content will be overwritten when updating
-->
<!-- END MKDOCS TEMPLATE -->
README.md 0 → 100644
<div align="center" style="text-align: center;">
<!-- Project Title -->
<a href="https://framagit.org/rdeville.public/my_programs/mkdocs_template">
<img src="docs/assets/img/meta/mkdocs_template_logo.png" width="100px">
<h1>Mkdocs Template</h1>
</a>
<!-- Project Badges -->
[![License][license_badge]][license]
[![Build Status][build_status_badge]][build_status]
--------------------------------------------------------------------------------
Template to easily setup and managed [mkdocs][mkdocs] documentation in folder
to have homogenous documentation.
--------------------------------------------------------------------------------
<b>
IMPORTANT !
Main repo is on [ Framagit][repo_url].<br>
On other online git platforms, they are just mirror of the main repo.<br>
Any issues, pull/merge requests, etc., might not be considered on those other
platforms.
</b>
</div>
--------------------------------------------------------------------------------
[repo_url]: https://framagit.org/rdeville.public/my_programs/mkdocs_template
[license_badge]: https://img.shields.io/badge/License-MIT%2FBeer%20Ware-blue?style=flat-square&logo=open-source-initiative
[license]: LICENSE
[build_status_badge]: https://framagit.org/rdeville.public/my_programs/mkdocs_template/badges/master/pipeline.svg?style=flat-square&logo=appveyor
[build_status]: https://framagit.org/rdeville.public/my_programs/mkdocs_template/commits/master
## Table of Content
* [Introduction](#introduction)
* [Usage](#usage)
* [Project Documentation](#project-documentation)
## Introduction
Since some times now, I use [mkdocs][mkdocs] to write documentation of my
projects.
While [mkdocs][mkdocs] is a really usefull software allowing me to
write clean and clear documentation in markdown and render it as static
website, I was tired to always copy/paste same configuration accross all my
projects documentations.
Even worst, when I decide to change some minor things (such as color palettes),
I had to go to each projects and for each project I had to replace manually
every time the same two configuration lines.
This project aims is to ease the management of documentation configuration by
allowing to create a template and easily setup or upgrade it to a newer
version.
## Usage
Assuming you want to use this **really** basic template. In a repo in which you
want to create a documentation, type the following commands:
```bash
# ASSUMING YOU ARE IN THE REPO FOR WHICH YOU WANT TO WRITE A DOCUMENTATION
# First download the setup script into a temporary folder
wget \
https://framagit.org/rdeville.public/my_programs/mkdocs_template/-/raw/master/setup.sh \
-O /tmp/setup_mkdocs.sh
# Then read the content of the script with your favorite editor
vim /tmp/setup_mkdocs.sh
# If you are confident with what the script does, make it executable and run it
chmod +x /tmp/setup_mkdocs.sh
/tmp/setup_mkdocs.sh -r https://framagit.org/rdeville.public/my_programs/mkdocs_template
```
Or if you already read the content of the script `setup.sh` at the root of this
repo, previous commands can be done in online:
```
# ASSUMING YOU ARE IN THE REPO FOR WHICH YOU WANT TO WRITE A DOCUMENTATION
# You can get the content of the script setup.sh via curl and pipe it into bash
curl -sfL \
https://framagit.org/rdeville.public/my_programs/mkdocs_template_rdeville/-/raw/master/setup.sh \
| bash -s -- -r https://framagit.org/rdeville.public/my_programs/mkdocs_template_rdeville
```
This will automatically create the folder `docs` with basic pages and the
following files:
- `mkdocs.yml`
- `requirements.docs.in`
- `requirements.docs.txt`
What you will now have to do is :
- Copy the provided template file `docs/_data/template/repo.tpl.yaml` into
`docs/_data/repo_name.yml` such as `repo_name` is the slug of your repo (for
instance slug of `mkdocs template` is `mkdocs_template` and slug of
`docs.domain.tld project` is `docs_domain_tld_project`).
- Edit this new file `docs/_data/repo_name.yml`, especially, do not forget to
change the key `repo_name` in the file accordingly to your repo slug.
You are ready now to render you documentation:
```bash
mkdocs serve
```
This is the basic usage of the template, but you might want to provide your own
configuration (such as other color palette or add a default license). This will
be explain in the [Online Documentation][online_doc].
<!-- BEGIN MKDOCS TEMPLATE -->
<!--
WARNING, DO NOT UPDATE CONTENT BETWEEN MKDOCS TEMPLATE TAG !
Modified content will be overwritten when updating
-->
## Project Documentation
The complete documentation of the project can be accessed via its [Online
Documentation][online_doc].
If, for any reason, the link to the [Online Documentation][online_doc] is
broken, you can generate its documention locally on your computer (since the
documentation is jointly stored within the repository).
To do so, you will need the following requirements:
- Python >= 3.8
- Pip3 with Python >= 3.8
First setup a temporary python virtual environment and activate it:
```bash
# Create the temporary virtual environment
python3 -m venv .temporary_venv
# Activate it
source .temporary_venv/bin/activate
```
Now, install required dependencies to render the documentation using
[mkdocs][mkdocs] in the python virtual environment:
```bash
pip3 install -r requirements.docs.txt
```
Now you can easily render the documentation using [mkdocs][mkdocs] through the
usage of the following command (some logs will be outputed to stdout):
```bash
# Assuming you are at the root of the repo
# If there is a `mkdocs.local.yml`
mkdocs serve -f mkdocs.local.yml
# If there is no `mkdocs.local.yml`, only `mkdocs.yml`
mkdocs serve
```
You can now browse the full documentation by visiting
[http://localhost:8000][localhost].
[localhost]: https://localhost:8000
[mkdocs]: https://www.mkdocs.org/
<!-- END MKDOCS TEMPLATE -->
[online_doc]: https://docs.romaindeville.fr/rdeville.public/my_programs/mkdocs_template/index.html
### BEGIN MKDOCS TEMPLATE ###
# ---------------------------------------------------------------------------
# Below content is automatically managed with repo mkdocs_template.
# Do not edit manually
# ---------------------------------------------------------------------------
# Website Information
# ---------------------------------------------------------------------------
site_name: "" # Automatically set by mkdocs_macros_plugin (see docs/_data/plugins.py)
#site_description: # Automatically set by mkdocs_macros_plugin (see docs/_data/plugins.py)
#site_url: # Automatically set by mkdocs_macros_plugin (see docs/_data/plugins.py)
#copyright: # Automatically set by mkdocs_macros_plugin (see docs/_data/plugins.py)
docs_dir: docs
# Repository Information
# ---------------------------------------------------------------------------
#repo_name: # Automatically set by mkdocs_macros_plugin (see docs/_data/plugins.py)
#repo_url: # Automatically set by mkdocs_macros_plugin (see docs/_data/plugins.py)
edit_uri: ""
# This setting controls the style used for linking to pages within the
# documentation.
use_directory_urls: false
# Theme Configuration
# ---------------------------------------------------------------------------
theme:
# Using mkdocs-material theme
# https://squidfunk.github.io/mkdocs-material/
name: material
# Overriding parent theme configuration
custom_dir: docs/theme
# Determines whether the search plugin expects the theme to provide a
# dedicated search page via a template located at search/search.html.
include_search_page: false
# Determines whether the search plugin should only generate a search
# index or a complete search solution.
search_index_only: true
# Language site
language: en
# Optional features like tabs and instant loading are now implemented
# as flags and can be enabled by listing them in mkdocs.yml under
# theme.features:
features:
- navigation.tabs
- navigation.instant
- navigation.top
# Setting colors palette (these are defined in docs/theme/css/{colors,theme}.css)
palette:
# Light mode
- media: "(prefers-color-scheme: light)"
scheme: rdeville-light
primary: rdeville-green-light
accent: rdeville-orange-light
toggle:
icon: material/weather-night
name: Switch to dark mode
# Dark mode
- media: "(prefers-color-scheme: dark)"
scheme: rdeville-dark
primary: rdeville-green-dark
accent: rdeville-orange-dark
toggle:
icon: material/weather-sunny
name: Switch to light mode
# Font configuration for the website (FurCode are provided in
# docs/theme/fonts)
font: false
# text: FuraCode Nerd Font
# code: FuraCode Nerd Font
# Path to logo and icons to use for the website
#logo: # Automatically set by mkdocs_macros_plugin (see docs/_data/plugins.py)
#icon:
# repo: # Automatically set by mkdocs_macros_plugin (see docs/_data/plugins.py)
#favicon: # Automatically set by mkdocs_macros_plugin (see docs/_data/plugins.py)
# External CSS
# ---------------------------------------------------------------------------
extra_css:
# Define css for lightgallery
# From: https://github.com/g-provost/lightgallery-markdown
- theme/css/lightgallery.css
# Define personal extra css
# Define colors (all materials colors RGB code)
- theme/css/colors.css
# Define fonts
- theme/css/fonts.css
# Define themes
- theme/css/theme.css
# Define css of base markdown extension and pymdown extension
- theme/css/python_markdown_extension.css
# External JS
# ---------------------------------------------------------------------------
extra_javascript:
# Define javascript for lightgallery
# From: https://github.com/g-provost/lightgallery-markdown
- theme/js/lightgallery.js
- theme/js/lg-video.js
# Define javascript for arithmatex (auto downloaded with tools/upgrade_external_dependencies)
# From: https://squidfunk.github.io/mkdocs-material/reference/mathjax/#arithmatex
- theme/js/polyfill.js
- theme/js/es5/tex-chtml.js
# Define javascript to allow table sorting
# From: https://squidfunk.github.io/mkdocs-material/reference/data-tables/#sortable-tables
- theme/js/tablesort.min.js
# Define javascript for mermaid
# From: https://github.com/fralau/mkdocs-mermaid2-plugin#explicit-declaration-of-the-mermaid-library
- theme/js/mermaid.js
# Define javascript for custom pymdown mermaid loader
# From: https://facelessuser.github.io/pymdown-extensions/extras/mermaid/#custom-loader
- theme/js/mermaid-loader.js
# Define personal custom javascript
- theme/js/extra.js
# Extensions
# ---------------------------------------------------------------------------
markdown_extensions:
# Allow to include markdown files
# https://github.com/sethen/markdown-include
- markdown_include.include:
base_path: ./
# Python Markdown Extensions
# https://python-markdown.github.io/extensions/
- markdown.extensions.toc:
slugify: !!python/name:pymdownx.slugs.uslugify
permalink: ""
- markdown.extensions.admonition:
- markdown.extensions.smarty:
smart_quotes: false
- markdown.extensions.attr_list:
- markdown.extensions.def_list:
- markdown.extensions.tables:
- markdown.extensions.abbr:
- markdown.extensions.footnotes:
- markdown.extensions.meta:
- markdown.extensions.md_in_html:
# Pymdown Extensions
# https://facelessuser.github.io/pymdown-extensions/extensions/arithmatex/
- pymdownx.extra:
- pymdownx.arithmatex:
generic: true
- pymdownx.betterem:
- pymdownx.details:
- pymdownx.caret:
- pymdownx.escapeall:
hardbreak: True
nbsp: True
- pymdownx.critic:
- pymdownx.emoji:
emoji_index: !!python/name:pymdownx.emoji.twemoji
emoji_generator: !!python/name:pymdownx.emoji.to_svg
options:
image_path: /assets/twemoji/svg/
custom_icons:
- .icons
- pymdownx.inlinehilite:
custom_inline:
- name: math
class: arithmatex
format: !!python/name:pymdownx.arithmatex.inline_generic_format
- pymdownx.highlight:
linenums: true
linenums_special: 2
linenums_style: pymdownx-inline
guess_lang: false
extend_pygments_lang:
- name: pycon3
lang: pycon
options:
python3: true
- pymdownx.keys:
separator: "\uff0b"
- pymdownx.mark:
- pymdownx.magiclink:
repo_url_shortener: true
- pymdownx.progressbar:
- pymdownx.pathconverter:
- pymdownx.smartsymbols:
- pymdownx.snippets:
- pymdownx.striphtml:
- pymdownx.superfences:
preserve_tabs: true
# Make exceptions to highlighting code of following classes:
custom_fences:
- name: math
class: arithmatex
format: !!python/name:pymdownx.arithmatex.fence_generic_format
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- pymdownx.tabbed:
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.tilde:
# Locally installed in docs/theme/plugins/ from original repo
# https://github.com/g-provost/lightgallery-markdown
- lightgallery:
# Extra Data Information & Customization
# ---------------------------------------------------------------------------
# Dictionary storing social icon that will be shown on the bottom right.
extra:
social:
- icon: fontawesome/solid/globe
link: https://romaindeville.fr
- icon: fontawesome/solid/paper-plane
link: mailto:contact@romaindeville.fr
- icon: fontawesome/solid/book-reader
link: https://docs.romaindeville.fr
- icon: fontawesome/brands/linkedin
link: https://www.linkedin.com/in/romaindeville
- icon: fontawesome/brands/docker
link: https://hub.docker.com/u/rdeville
- icon: fontawesome/brands/git-alt
link: https://framagit.org/rdeville.public/
- icon: fontawesome/brands/gitlab
link: https://gitlab.com/rdeville.public/
- icon: fontawesome/brands/github
link: https://github.com/rdeville-public/
version:
provider: mike
# Plugins
# ---------------------------------------------------------------------------
plugins:
- search:
# https://github.com/timvink/mkdocs-git-revision-date-localized-plugin
# MkDocs plugin that enables displaying the date of the last git
# modification of a page.
- git-revision-date-localized:
locale: en
fallback_to_build_date: true
# https://github.com/oprypin/mkdocs-section-index
# MkDocs plugin to allow clickable sections that lead to an index page
- section-index:
# https://github.com/apenwarr/mkdocs-exclude
# A mkdocs plugin that lets you exclude files or trees.
- exclude:
regex:
- .*theme.*.md
# https://github.com/fralau/mkdocs_macros_plugin
# Unleash the power of MkDocs with variables and macros
- macros:
module_name: docs/_data/plugins
include_dir: ./
include_yaml:
- docs/_data/vars.yaml
# Others yaml include are done automatically using
# mkdocs_macros_plugin (see docs/_data/plugins.py)
# https://spotify.github.io/mkdocs-monorepo-plugin/
# This plugin enables you to build multiple sets of documentation in a
# single Mkdocs.
- monorepo:
# A Mermaid graphs plugin for mkdocs
# https://github.com/fralau/mkdocs-mermaid2-plugin#declaring-the-superfences-extension
- mermaid2:
arguments:
theme: |
^(localStorage.getItem('theme') === 'rdeville-dark') ? 'dark' : 'light'
# https://pawamoy.github.io/mkdocstrings/
# Automatic documentation from sources, for MkDocs.
- mkdocstrings:
default_handler: python
handlers:
python:
rendering:
show_source: true
show_if_no_docstring: true
setup_commands:
- import sys
# Others command such as sys.path.append("path") are
# Automatically added using mkdocs_macros_plugin
# (see docs/_data/plugins.py)
# DO NOT FORGET TO ADD/UPDATE THE \`nav\` KEY BELOW.
### END MKDOCS TEMPLATE ###
# Navigation Pane
# ---------------------------------------------------------------------------
nav:
- Home: index.md
- Code References:
- setup.sh: references/setup.md
- preview.sh: references/preview.md
- tools:
- generate_source_docs.sh: references/tools/generate_source_docs.md
- templates:
- docs:
- _data:
- plugins.py: references/templates/docs/_data/plugins.py.md
- About:
- about/index.md
- Code of Conduct: about/code_of_conduct.md
- Contributing: about/contributing.md
- License: about/license.md
- Release Notes: about/release_notes.md
- Data Privacy: about/data_privacy.md
# *****************************************************************************
# VIM MODELINE
# vim: ft=yaml: fdm=indent
# *****************************************************************************
#!/usr/bin/env bash
# """Setup a temporary documentation folder to preview the rendering of the template
#
# SYNOPSIS:
# `./preview.sh [-c|--clean] [-r|--very-clean]`
#
# DESCRIPTION:
# This script will build the final list of folder that will be installed in
# the folder that will host the documenation and render a preview of such
# basic documentation based from template.
#
# This will be done by creating symlinks from `templates` and `user_config`
# folders into `preview` folder.
#
# Available options are:
#
# * `-c,--clean` : Remove every existing symlinks before rendering the
# preview.
#
# * `-r,--very-clean` : Remove every existing symlinks without rendering the
# preview.
#
# * `-h,--help` : Print this help.
#
# """
# Set constant variables
MKDOCS_ROOT="${PWD}"
MKDOCS_TMP="${MKDOCS_ROOT}/preview"
MKDOCS_DEBUG_LEVEL="DEBUG"
SCRIPT_PATH="$( cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 || return 1 ; pwd -P )"
SCRIPT_FULL_PATH="${SCRIPT_PATH}/$(basename "${BASH_SOURCE[0]}")"
main()
{
# """Setup preview folder to be able to see the rendering of the documentation template.
#
# Build the list of the file that will be installed if using the mkdocs
# documentation template, make a symlinks of all these files into `preview`
# folder and, depending on the options provided, render the documentation
# preview.
#
# Globals:
# UPGRADE
# SUBREPO
# REPO_URL
# MKDOCS_ROOT
# MKDOCS_TMP
# MKDOCS_CLONE_ROOT
#
# Arguments:
# * `-c,--clean` : Remove every existing symlinks before rendering the preview.
# * `-r,--very-clean` : Remove every existing symlinks without rendering the preview.
# * `-h,--help` : Print this help.
#
# Output:
# Log informations
#
# Returns:
# 0, if rendering of the preview documentation went right.
# 1, if rendering of the preview documentation went wrong.
#
# """
manpage()
{
# """Extract the script documentation from header and print it on stdout.
#
# Simply extract the docstring from the header of the script, format it with
# some output enhancement (such as bold) and print it to stdout.
#
# Globals:
# SCRIPT_FULL_PATH
#
# Arguments:
# None
#
# Output:
# Help to stdout
#
# Returns:
# None
#
# """
local e_normal="\\\e[0m" # Normal (usually white fg & transparent bg)
local e_bold="\\\e[1m" # Bold
# Extract module documentation and format it
help_content="$(\
sed -n -e "/^# \"\"\".*/,/^# \"\"\"/"p "${SCRIPT_FULL_PATH}" \
| sed -e "s/^# \"\"\"//g" \
-e "s/^# //g" \
-e "s/^#$//g" \
-e "s/DESCRIPTION[:]/${e_bold}DESCRIPTION${e_normal}\n/g" \
-e "s/COMMANDS[:]/${e_bold}COMMANDS${e_normal}\n/g" \
-e "s/OPTIONS[:]/${e_bold}OPTIONS${e_normal}\n/g" \
-e "s/SYNOPSIS[:]/${e_bold}SYNOPSIS${e_normal}\n/g")"
echo -e "${help_content}"
exit 0
}
# - SC2034: var appears unused, Verify use (or export if used externally)
# shellcheck disable=SC2034
mkdocs_log()
{
# """Print debug message in colors depending on message severity on stderr.
#
# Echo colored log depending on user provided message severity. Message
# severity are associated to following color output:
#
# - `DEBUG` print in the fifth colors of the terminal (usually magenta)
# - `INFO` print in the second colors of the terminal (usually green)
# - `WARNING` print in the third colors of the terminal (usually yellow)
# - `ERROR` print in the third colors of the terminal (usually red)
#
# If no message severity is provided, severity will automatically be set to
# INFO.
#
# Globals:
# ZSH_VERSION
#
# Arguments:
# $1: string, message severity or message content
# $@: string, message content
#
# Output:
# Log informations colored
#
# Returns:
# None
#
# """
# Store color prefixes in variable to ease their use.
# Base on only 8 colors to ensure portability of color when in tty
local e_normal="\e[0m" # Normal (usually white fg & transparent bg)
local e_bold="\e[1m" # Bold
local e_underline="\e[4m" # Underline
local e_debug="\e[0;35m" # Fifth term color (usually magenta fg)
local e_info="\e[0;32m" # Second term color (usually green fg)
local e_warning="\e[0;33m" # Third term color (usually yellow fg)
local e_error="\e[0;31m" # First term color (usually red fg)
# Store preformated colored prefix for log message
local error="${e_bold}${e_error}[ERROR]${e_normal}${e_error}"
local warning="${e_bold}${e_warning}[WARNING]${e_normal}${e_warning}"
local info="${e_bold}${e_info}[INFO]${e_normal}${e_info}"
local debug="${e_bold}${e_debug}[DEBUG]${e_normal}${e_debug}"
local color_output="e_error"
local msg_severity
local msg
# Not using ${1^^} to ensure portability when using ZSH
msg_severity=$(echo "$1" | tr '[:upper:]' '[:lower:]')
if [[ "${msg_severity}" =~ ^(error|time|warning|info|debug)$ ]]
then
# Shift arguments by one such that $@ start from the second arguments
shift
# Place the content of variable which name is defined by ${msg_severity}
# For instance, if `msg_severity` is INFO, then `prefix` will have the same
# value as variable `info`.
if [[ -n "${ZSH_VERSION}" ]]
then
prefix="${(P)msg_severity}"
else
prefix="${!msg_severity}"
fi
color_output="e_${msg_severity}"
else
prefix="${info}"
fi
if [[ -n "${ZSH_VERSION}" ]]
then
color_output="${(P)color_output}"
else
color_output="${!color_output}"
fi
# Concat all remaining arguments in the message content and apply markdown
# like syntax.
msg_content=$(echo "$*" \
| sed -e "s/ \*\*/ \\${e_bold}/g" \
-e "s/\*\*\./\\${e_normal}\\${color_output}./g" \
-e "s/\*\* /\\${e_normal}\\${color_output} /g" \
-e "s/\*\*$/\\${e_normal}\\${color_output} /g" \
-e "s/ \_\_/ \\${e_underline}/g" \
-e "s/\_\_\./\\${e_normal}\\${color_output}./g" \
-e "s/\_\_ /\\${e_normal}\\${color_output} /g")
msg="${prefix} ${msg_content}${e_normal}"
# Print message or not depending on message severity and MKDOCS_DEBUG_LEVEL
if [[ -z "${MKDOCS_DEBUG_LEVEL}" ]] && [[ "${msg_severity}" == "error" ]]
then
echo -e "${msg}" 1>&2
elif [[ -n "${MKDOCS_DEBUG_LEVEL}" ]]
then
case ${MKDOCS_DEBUG_LEVEL} in
DEBUG)
echo "${msg_severity}" \
| grep -q -E "(debug|info|warning|error)" && echo -e "${msg}" 1>&2
;;
INFO)
echo "${msg_severity}" \
| grep -q -E "(info|warning|error)" && echo -e "${msg}" 1>&2
;;
WARNING)
echo "${msg_severity}" \
| grep -q -E "(warning|error)" && echo -e "${msg}" 1>&2
;;
ERROR)
echo "${msg_severity}" \
| grep -q -E "error" && echo -e "${msg}" 1>&2
;;
esac
fi
}
build_file_list()
{
# """Recursively build a list of file from provided folder
#
# Recursively build a list of file from provided folder and store such list
# in a temporary bash array that must be set in parent method.
#
# Globals:
# None
#
# Arguments:
# $1: string, absolute path to the folder which will be parsed
#
# Output:
# None
#
# Returns:
# None
#
# """
local folder=$1
for i_node in "$folder"/* "$folder"/.*
do
if ! [[ "${i_node}" =~ ^${folder}\/[\.]+$ ]] \
&& ! [[ "${i_node}" =~ __pycache__ ]]
then
if [[ -f "${i_node}" ]]
then
tmp_nodes+=("${i_node}")
elif [[ -d "${i_node}" ]]
then
build_file_list "${i_node}"
fi
fi
done
}
build_final_file_list()
{
# """Build the merged list from `templates` and `user_config` folder.
#
# If there is the same file in `user_config` and `templates` folder, then
# replace the file to be installed from `templates` by the one in
# `user_config`. Finally, add remaining `user_config` files not in
# `templates` to the list of files to install or upgrade in a bash array set
# in parent method.
#
# Globals:
# MKDOCS_ROOT
#
# Arguments:
# None
#
# Output:
# None
#
# Returns:
# None
#
# """
for i_template_node in "${template_nodes[@]##*templates\/}"
do
found="false"
for i_user_node in "${user_nodes[@]##*user_config\/}"
do
if [[ ${i_template_node} =~ ^${i_user_node}$ ]]
then
found="true"
fi
done
if [[ "${found}" == "false" ]]
then
tmp_nodes+=("templates/${i_template_node}")
fi
done
for i_user_node in "${user_nodes[@]##*user_config\/}"
do
tmp_nodes+=("user_config/${i_user_node}")
done
tmp_nodes=("${tmp_nodes[@]##*${MKDOCS_ROOT}\/}")
}
clean_preview()
{
# """Recursively clean the preview folder by removing all symlinks
#
# Simply remove recursively all symlinks from folder `preview`.
#
# Globals:
# MKDOCS_ROOT
# MKDOCS_CLONE_ROOT
#
# Arguments:
# None
#
# Output:
# Log message
#
# Returns:
# None
#
# """
local path=$1
if [[ -d "${path}" ]] && ! rmdir "${path}" &> /dev/null
then
mkdocs_log "INFO" "Cleaning **${path##*${MKDOCS_ROOT}\/}"
for i_node in "${path}"/*
do
if [[ -d "${i_node}" ]]
then
clean_preview "${i_node}"
elif [[ -L "${i_node}" ]]
then
rm "${i_node}"
fi
done
rmdir --ignore-fail-on-non-empty "${path}"
fi
}
setup_mkdocs()
{
# """Recursively install base folder and script to render a preview of the documentation template.
#
# Build the list of files and folders, recursively create a symlink of all
# files to their right location from the temporary clone repo to the folder
# `preview`.
#
# Globals:
# MKDOCS_ROOT
# MKDOCS_CLONE_ROOT
#
# Arguments:
# None
#
# Output:
# Log message
#
# Returns:
# None
#
# """
local tmp_nodes=()
local template_nodes=()
local user_nodes=()
local file_from
local dir
local i_node
local file_from
local file_to
mkdocs_log "INFO" "Building list of files"
build_file_list "${MKDOCS_ROOT}/templates"
template_nodes=("${tmp_nodes[@]}")
tmp_nodes=()
build_file_list "${MKDOCS_ROOT}/user_config"
user_nodes=("${tmp_nodes[@]}")
tmp_nodes=()
build_final_file_list
for i_node in "${tmp_nodes[@]}"
do
file_from="${MKDOCS_ROOT}/${i_node}"
file_to="${MKDOCS_TMP}/${i_node//user_config\/}"
file_to="${file_to//templates\/}"
if ! [[ -d "$(dirname "${file_to}")" ]]
then
dir=$(dirname "${file_to}")
mkdocs_log "INFO" "Create dir **${dir##*${MKDOCS_ROOT}\/}**."
mkdir -p "${dir}"
fi
if ! [[ "${file_to}" =~ \.gitkeep$ ]] && ! [[ "${file_to}" =~ \/mkdocs.local.yml ]]
then
if ! [[ -e "${file_to}" ]]
then
ln -s "${file_from}" "${file_to}"
fi
elif [[ "${file_to}" =~ \/mkdocs.local.yml ]]
then
mkdocs_log "INFO" "Updating ${file_to##*${MKDOCS_ROOT}\/}"
cat "${file_from}" > "${file_to}"
echo " - Example: example.md" >> "${file_to}"
fi
done
}
# Parse arguments
while [[ $# -gt 0 ]]
do
case "$1" in
--clean|-c)
clean_preview "${MKDOCS_ROOT}/preview"
shift
;;
--very-clean|-r)
clean_preview "${MKDOCS_ROOT}/preview"
return
;;
--help|-h)
manpage
;;
esac
done
# Set color prefix
local e_normal="\e[0m" # normal (white fg & transparent bg)
local e_bold="\e[1m" # bold
local e_warning="\e[0;33m" # yellow fg
local e_error="\e[0;31m" # red fg
local e_info="\e[0;32m" # green fg
setup_mkdocs
cd "${MKDOCS_TMP}" || exit 1
mkdocs serve -f "${MKDOCS_TMP}/mkdocs.local.yml"
cd "${MKDOCS_ROOT}" || exit 1
}
main "${@}"
# ------------------------------------------------------------------------------
# VIM MODELINE
# vim: ft=bash: foldmethod=indent
# ------------------------------------------------------------------------------
\ No newline at end of file
*
\ No newline at end of file
# Repo information
# ===========================================================================
# First key MUST be the "slug" of the repo based on the remote, i.e. if remote
# is git@git.domain.tld:username/repo_name.git, then the key will be
# `repo_name`.
mkdocs_template:
# An explicit name for the repo that will be shown on the documentation
# page.
name: "Mkdocs Template"
#logo: assets/img/meta/mkdocs_template_logo.png
# (OPTIONATL) An extension of the explicit name with the namespace in which
# the repo is. For instance, using above remote, the entry will be
# `Username / Repo Name`.
# This entry is not used in the configuration of mkdocs.
git_name_with_namespace: "My Programs / Mkdocs Template"
# The complete path of the repo from the git_platform["url"]. For instance,
# using, above remote, the entry will be `username/repo_name.git`
git_slug_with_namespace: "rdeville.public/my_programs/mkdocs_template"
# If the repo documentation is part of a bigger repo, then provide the
# path of the rendered documentation. If the documentation is not part of
# another repo, leave it empty.
url_slug_with_namespace: "my_programs/mkdocs_template"
# (OPTIONAL) Path, relative to `docs_dir` mkdocs config, to the logo of the
# repo. If not specified, path will automatically be set to
# `assets/img/meta/reop_name_logo.png`
#logo: "assets/img/meta/repo_template_logo.png"
# Description of the repo, will be used to setup the mkdocs description.
desc: >-
Mkdocs Templates scaffolding project to host documentation configuration
and themes to manage homogenous documentation accros multiple projects.
# (OPTIONAL) If you plan to use `mkdocstring` plugins to render python
# source code, you will need to provide the path where your source files
# are relative to the root of the repo.
src_path:
- "templates/docs/_data/plugins.py"
- "user_config/docs/_data/plugins.py"
# List of informations about the main maintainers that will be automatically
# added to the license file in `docs/about/license.md`
maintainers:
- name: "Romain Deville"
mail: "dev@romaindeville.fr"
\ No newline at end of file
### BEGIN MKDOCS TEMPLATE ###
### WARNING, DO NOT UPDATE CONTENT BETWEEN MKDOCS TEMPLATE TAG !###
### Modified content will be overwritten when updating.###
# Extra Data Information & Customization
# ===========================================================================
# Dictionnary storing variables to be used as "Jinja2" variables within
# markdown files and _data/plugins.py
# Mkdocs.yaml
# ---------------------------------------------------------------------------
# Here you can overwrite main key you could find in mkdocs.yaml
# The name of your site, if not specified, will be the entry `name` of the repo in
# `_data/repo_name.yaml`
#site_name: "Your Site Name"
# The site description of your site, if not specified will be the description
# of the repo in `_data/repo_name.yaml`
#site_desc: "A short description"
# The url of your site, if not specified, then the site_url will be build from
# the key `site_base_url` below and the `url_slug_with_namespace` in
# `_data/repo_name.yaml`. If `site_base_url` is not specified, then value of
# `site_url` will not be overwritten.
#site_url: "https://my_site.tld"
# The name or company which old the copyright. No need to specify any date
# as it will be built based on the first commit of your repo. If not specify,
# then no copyright will be shown on the footer of the documentation.
#copyright: "Firstname Lastname"
# Name of your repo, if not specified, will be the key `mkdocs_repo_name` in
# `_data/repo_name.yaml` If value is EXACTLY "!!git_platform", then the value
# will be `git_platform["name"]` (see below).
#repo_name: "My Repo Name"
# URL to the source code of your repo. If not specified, will be build from
# `git_platform["url"]` (see below) and `repo_name["git_slug_with_namespace"]`
# in `_data/repo_name.yaml`.
#repo_url: "https://mygit.tld/namespace/repo_name
# You can override every entry of the `theme` key in `mkdocs.yaml`, here.
# Usefull to override templated mkdocs.
#
# REMARK, ONLY FOR MATERIAL-MKDOCS THEME
# If `theme["logo"]` is not specified, i.e. path to the logo image, then it
# will be set to the value of the key `repo_name["logo"]` in
# `_data/repo_name.yaml` if specified.
#
# If `theme["favicon"]` is not specified, i.e. path to the favicon image,
# then it will be set to the value of the key `repo_name["logo"]` in
# `_data/repo_name.yaml` if specified.
#
# If `theme["icon"]["repo"]` is not specified, i.e. icon "path" (see
# https://squidfunk.github.io/mkdocs-material/reference/icons-emojis/) that
# will be shown on the top rigt corner in front off the repo name, then it
# will be set to the value of the key `git_platform["icon"]` (see below).
#theme:
# logo: "path/to/logo.svg"
# icon:
# repo: fontawesome/brands/gitlab
# favicon: "path/to/favicon.svg"
# Main repo configuration
# ---------------------------------------------------------------------------
# Here you can specify variable about your main repo documentation
# The base url of your site, e.g. if you are using multiple nested
# documentation build with monorepo, you might want to share the same base URL
# for all your repo, then build link from the repo["url_slug_with_namespace"].
#site_url: "https://my_site.tld"
# Git platform
# ---------------------------------------------------------------------------
# In this REQUIRED section you will be able to specify some information for you
# git platform hosting your repo. This section will be used to automatically
# setup configuration for mkdocs such as `repo_url`, theme["icon"]["repo"] etc.
# Main dict entry
git_platform:
# The logo of the git platform you use. Not used in mkdocs configuration but
# can be used in markdown documentation file.
logo: " "
# Icon "path" (see
# https://squidfunk.github.io/mkdocs-material/reference/icons-emojis/) that
# will be shown on the top rigt corner in front off the repo name if not
# specified in `theme["icon"]["repo"]`.
icon: "fontawesome/brands/gitlab"
# Name of the platform you use.
name: "Framagit"
# URL of the platform you use, to be able to set `repo_url` for mkdocs
# configuration.
url: "https://framagit.org/"
### END MKDOCS TEMPLATE ###
---
toc:
toc_depth: 3
---
# Examples
!!! important "Informations"
Most of this content was directly take from [Pymdown
Extension](https://facelessuser.github.io/pymdown-extensions/).
This page aims to provide user example content for:
- Basic markdown
- Markdown Extension
- Pymdown Extension
To help seeing every possible thing to do to customize CSS.
Link to documentation of pymdown extension is provided with the title of
each section.
{% include "docs/preview_example/markdown.md" %}
{% include "docs/preview_example/arithmatex.md" %}
{% include "docs/preview_example/betterem.md" %}
{% include "docs/preview_example/caret.md" %}
{% include "docs/preview_example/critic.md" %}
{% include "docs/preview_example/details.md" %}
{% include "docs/preview_example/emoji.md" %}
{% include "docs/preview_example/escapeall.md" %}
{% include "docs/preview_example/inlinehilite.md" %}
{% include "docs/preview_example/keys.md" %}
{% include "docs/preview_example/magick.md" %}
{% include "docs/preview_example/mark.md" %}
{% include "docs/preview_example/progressbar.md" %}
{% include "docs/preview_example/saneheader.md" %}
{% include "docs/preview_example/smartsymbols.md" %}
{% include "docs/preview_example/striphtml.md" %}
{% include "docs/preview_example/superfences.md" %}
{% include "docs/preview_example/tabbed.md" %}
{% include "docs/preview_example/tasklist.md" %}
{% include "docs/preview_example/tilde.md" %}
{% include "docs/preview_example/code_sample.md" %}
## Videos Test
<div id="html5-videos" align="center">
<video controls>
<source src="http://techslides.com/demos/sample-videos/small.webm" type="video/webm">
Your browser does not support HTML5 video.
</video>
</div>
## [Arithmatex](https://facelessuser.github.io/pymdown-extensions/extensions/arithmatex/)
??? info "Arithmatex"
### Overview
Arithmatex is an extension that preserves LaTeX math equations during the
Markdown conversion process so that they can be used with libraries like
MathJax.
Arithmatex searches for the patterns `#!tex $...$` and `#!tex \(...\)` for
inline math, and `#!tex $$...$$`, `#!tex \[...\]`, and `#!tex
\begin{}...\end{}` for block math. By default, all formats are enabled, but
each format can individually be disabled if desired.
### Examples
!!! example "Inline Examples"
=== "Output"
$p(x|y) = \frac{p(y|x)p(x)}{p(y)}$, \(p(x|y) = \frac{p(y|x)p(x)}{p(y)}\).
=== "Markdown"
```tex
$p(x|y) = \frac{p(y|x)p(x)}{p(y)}$, \(p(x|y) = \frac{p(y|x)p(x)}{p(y)}\).
```
!!! example "Block Examples"
=== "Output"
$$
E(\mathbf{v}, \mathbf{h}) = -\sum_{i,j}w_{ij}v_i h_j - \sum_i b_i v_i - \sum_j c_j h_j
$$
\[3 < 4\]
\begin{align}
p(v_i=1|\mathbf{h}) & = \sigma\left(\sum_j w_{ij}h_j + b_i\right) \\
p(h_j=1|\mathbf{v}) & = \sigma\left(\sum_i w_{ij}v_i + c_j\right)
\end{align}
=== "Markdown"
```tex
$$
E(\mathbf{v}, \mathbf{h}) = -\sum_{i,j}w_{ij}v_i h_j - \sum_i b_i v_i - \sum_j c_j h_j
$$
\[3 < 4\]
\begin{align}
p(v_i=1|\mathbf{h}) & = \sigma\left(\sum_j w_{ij}h_j + b_i\right) \\
p(h_j=1|\mathbf{v}) & = \sigma\left(\sum_i w_{ij}v_i + c_j\right)
\end{align}
```
### Alternative Math Blocks
!!! example "Inline Math"
=== "Output"
`#!math p(x|y) = \frac{p(y|x)p(x)}{p(y)}`
=== "Markdown"
```
`#!math p(x|y) = \frac{p(y|x)p(x)}{p(y)}`
```
!!! example "Math Fences"
=== "Output"
```math
\begin{align}
p(v_i=1|\mathbf{h}) & = \sigma\left(\sum_j w_{ij}h_j + b_i\right) \\
p(h_j=1|\mathbf{v}) & = \sigma\left(\sum_i w_{ij}v_i + c_j\right)
\end{align}
```
=== "Markdown"
````
```math
\begin{align}
p(v_i=1|\mathbf{h}) & = \sigma\left(\sum_j w_{ij}h_j + b_i\right) \\
p(h_j=1|\mathbf{v}) & = \sigma\left(\sum_i w_{ij}v_i + c_j\right)
\end{align}
```
````
#### Subset h3 example
## [BetterEm](https://facelessuser.github.io/pymdown-extensions/extensions/betterem/)
??? info "BetterEM"
### Examples
!!! Note "Note"
For all examples on this page, underscores are __smart__ and asterisks are not.
BetterEm requires that non-whitespace characters follow the opening
token(s) and precede the closing token(s).
!!! example "Whitespace Example"
=== "Output"
This * won't emphasize *
This *will emphasize*
=== "Markdown"
```
* Won't highlight *
*Will highlight*
```
BetterEm allows for a more natural nested token feel.
!!! example "Nested Token Example"
=== "Output"
***I'm italic and bold* I am just bold.**
***I'm bold and italic!** I am just italic.*
=== "Markdown"
```
***I'm italic and bold* I am just bold.**
***I'm bold and italic!** I am just italic.*
```
BetterEm will ensure smart mode doesn't terminate in scenarios where there
are a large amount of consecutive tokens inside.
!!! example "Consecutive Token Example"
=== "Output"
___A lot of underscores____________is okay___
___A lot of underscores____________is okay___
=== "Markdown"
```
___A lot of underscores____________is okay___
___A lot of underscores____________is okay___
```
BetterEm will also ensure that smart mode breaks proper when an inner like
token signifies an end.
!!! example "Smart Break Example"
=== "Output"
__This will all be bold __because of the placement of the center underscores.__
__This will all be bold __ because of the placement of the center asterisks.__
__This will NOT all be bold__ because of the placement of the center underscores.__
__This will all be bold_ because the token count is less than that of the surrounding.__
=== "Markdown"
```
__This will all be bold __because of the placement of the center underscores.__
__This will all be bold __ because of the placement of the center underscores.__
__This will NOT all be bold__ because of the placement of the center underscores.__
__This will all be bold_ because of the token is less than that of the surrounding.__
```
BetterEm will allow non-smart emphasis to contain "floating" like tokens.
!!! example "Floating Token Example"
=== "Output"
*All will * be italic*
*All will *be italic*
*All will not* be italic*
*All will not ** be italic*
**All will * be bold**
**All will *be bold**
**All will not*** be bold**
**All will not ***be bold**
=== "Markdown"
```
*All will * be italic*
*All will *be italic*
*All will not* be italic*
*All will not ** be italic*
**All will * be bold**
**All will *be bold**
**All will not*** be bold**
**All will not *** be bold**
```
## [Caret](https://facelessuser.github.io/pymdown-extensions/extensions/caret/)
??? info "Caret"
### Example Insert
To wrap content in an **insert** tag, simply surround the text with double
`^`. You can also enable `smart_insert` in the options. Smart
behavior of **insert** models that of BetterEm.
!!! example "Insert Example"
=== "Output"
^^Insert me^^
=== "Markdown"
```
^^Insert me^^
```
### Example Superscript
To denote a superscript, you can surround the desired content in single
`^`. It uses Pandoc style logic, so if your superscript needs to have
spaces, you must escape the spaces.
!!! example "Superscript Example"
=== "Output"
H^2^0
text^a\ superscript^
=== "Markdown"
```
H^2^0
text^a\ superscript^
```
## Code samples
??? info "Code Sample"
=== "Python"
```python3
{% filter indent(width=8) %}
{% include "docs/preview_example/code_sample/python_sample.py" %}
{% endfilter %}
```
=== "Java"
```java
{% filter indent(width=8) %}
{% include "docs/preview_example/code_sample/java_sample.java" %}
{% endfilter %}
```
=== "HTML"
```html
{% filter indent(width=8) %}
{% include "docs/preview_example/code_sample/html_sample.html" %}
{% endfilter %}
```
=== "CSS"
```css
{% filter indent(width=8) %}
{% include "docs/preview_example/code_sample/css_sample.css" %}
{% endfilter %}
```
=== "Javascript"
```javascript
{% filter indent(width=8) %}
{% include "docs/preview_example/code_sample/javascript_sample.js" %}
{% endfilter %}
```
@font-face {
font-family: 'lg';
src:
url("../fonts/lg.ttf?22t19m") format("truetype"),
url("../fonts/lg.woff?22t19m") format("woff"),
url("../fonts/lg.svg?22t19m#lg") format("svg");
font-weight: normal;
font-style: normal;
font-display: block;
}
.lg-icon {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: 'lg' !important;
speak: never;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.lg-actions .lg-next,
.lg-actions .lg-prev {
background-color: rgba(0, 0, 0, 0.45);
border-radius: 2px;
color: #999;
cursor: pointer;
display: block;
font-size: 22px;
margin-top: -10px;
padding: 8px 10px 9px;
position: absolute;
top: 50%;
z-index: 1080;
outline: none;
border: none;
background-color: transparent;
}
@-webkit-keyframes lg-right-end {
0% {
left: 0;
}
50% {
left: -30px;
}
100% {
left: 0;
}
}
.lg-outer.lg-right-end .lg-object {
-webkit-animation: lg-right-end 0.3s;
-o-animation: lg-right-end 0.3s;
animation: lg-right-end 0.3s;
position: relative;
}
.lg-toolbar .lg-icon {
color: #999;
cursor: pointer;
float: right;
font-size: 24px;
height: 47px;
line-height: 27px;
padding: 10px 0;
text-align: center;
width: 50px;
text-decoration: none !important;
outline: medium none;
background: none;
border: none;
box-shadow: none;
-webkit-transition: color 0.2s linear;
-o-transition: color 0.2s linear;
transition: color 0.2s linear;
}
.lg-toolbar .lg-close:after {
content: "\e070";
}
.lg-toolbar,
.lg-prev,
.lg-next {
opacity: 1;
-webkit-transition:
-webkit-transform 0.35s cubic-bezier(0, 0, 0.25, 1) 0s,
opacity 0.35s cubic-bezier(0, 0, 0.25, 1) 0s,
color 0.2s linear;
-moz-transition: -moz-transform 0.35s cubic-bezier(0, 0, 0.25, 1) 0s,
opacity 0.35s cubic-bezier(0, 0, 0.25, 1) 0s,
color 0.2s linear;
-o-transition:
-o-transform 0.35s cubic-bezier(0, 0, 0.25, 1) 0s,
opacity 0.35s cubic-bezier(0, 0, 0.25, 1) 0s,
color 0.2s linear;
transition:
transform 0.35s cubic-bezier(0, 0, 0.25, 1) 0s,
opacity 0.35s cubic-bezier(0, 0, 0.25, 1) 0s,
color 0.2s linear;
}
body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item.lg-complete .lg-object {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
opacity: 1;
}
<!-- a -->
<a>Link without href</a>
<a class="button">Link without href: Button</a>
<a href="#">Link without href</a>
<a class="button" href="#">Link without href: Button</a>
<!-- abbr -->
<abbr title="Abbreviation">abbr</abbr>
<!-- address -->
<address>
You can contact author at <a href="http://www.somedomain.com/contact">www.somedomain.com</a>.<br>
If you see any bugs, please <a href="mailto:webmaster@somedomain.com">contact webmaster</a>.<br>
You may also want to visit us:<br>
Mozilla Foundation<br>
1981 Landings Drive<br>
Building K<br>
Mountain View, CA 94043-0801<br>
USA
</address>
<!-- area -->
<map name="primary">
<area shape="circle" coords="200,250,25" href="http://google.com" />
<area shape="default" nohref />
</map>
<!-- article -->
<article>
<h4>A really awesome article</h4>
<p>Lots of awesome text.</p>
</article>
<!-- aside -->
<article>
<p>
The Disney movie <em>The Little Mermaid</em> was
first released to theatres in 1989.
</p>
<aside>
The movie earned $87 million during its initial release.
</aside>
<p>
More info about the movie...
</p>
</article>
<!-- audio -->
<audio src="http://developer.mozilla.org/@api/deki/files/2926/=AudioTest_(1).ogg" autoplay>
Your browser does not support the <code>audio</code> element.
</audio>
<audio src="foo.ogg">
<track kind="captions" src="foo.en.vtt" srclang="en" label="English">
<track kind="captions" src="foo.sv.vtt" srclang="sv" label="Svenska">
</audio>
<audio controls="controls">
Your browser does not support the <code>audio</code> element.
<source src="foo.wav" type="audio/wav">
</audio>
<!-- b -->
<b>Bold</b>
<!-- bdi -->
<bdi>ARABIC_PLACEHOLDER</bdi>
<!-- bdo -->
<bdo dir="rtl">This text will go right to left.</bdo>
<!-- blockquote -->
<blockquote cite="http://developer.mozilla.org">
<p>This is a quotation taken from the Mozilla Developer Center.</p>
</blockquote>
<!-- button -->
<button>Button</button>
<!-- canvas -->
<canvas id="canvas" width="300" height="300">
Sorry, your browser doesn't support the &lt;canvas&gt; element.
</canvas>
<!-- cite -->
<cite>[ISO-0000]</cite>
<!-- code -->
<code>Code Block</code>
<!-- data -->
<data value="12345">Data</data>
<!-- datalist -->
<input list="browsers" />
<datalist id="browsers">
<option value="Chrome">
<option value="Firefox">
<option value="Internet Explorer">
<option value="Opera">
<option value="Safari">
</datalist>
<!-- del -->
<del>This text has been deleted</del>
<!-- details -->
<details>
<summary>Some details</summary>
<p>More info about the details.</p>
</details>
<!-- dfn, dt, dd, dl -->
<dl>
<dt>
<dfn>
<abbr title="World-Wide Web">WWW</abbr>
</dfn>
</dt>
<dd>The World-Wide Web (WWW) is a system of interlinked hypertext documents accessed on <a href="#def-internet">the Internet</a>.</dd>
</dl>
<!-- dialog -->
<dialog open>
<p>Greetings, one and all!</p>
</dialog>
<dialog id="favDialog">
<form method="dialog">
<section>
<p><label for="favAnimal">Favorite animal:</label>
<select id="favAnimal" name="favAnimal">
<option></option>
<option>Brine shrimp</option>
<option>Red panda</option>
<option>Spider monkey</option>
</select></p>
</section>
<menu>
<button id="cancel" type="reset">Cancel</button>
<button type="submit">Confirm</button>
</menu>
</form>
</dialog>
<menu>
<button id="updateDetails">Update details</button>
</menu>
<!-- em -->
<em>Emphasis</em>
<!-- embed -->
<embed type="video/quicktime" src="movie.mov" width="640" height="480"></embed>
<!-- fieldset -->
<form action="test.php" method="post">
<fieldset>
<legend>Title</legend>
<input type="radio" name="radio" id="radio"> <label for="radio">Click me</label>
</fieldset>
</form>
<!-- figure, figcaption -->
<figure>
<img src="https://developer.cdn.mozilla.net/media/img/mdn-logo-sm.png" alt="An awesome picture">
</figure>
<p></p>
<figure>
<img src="https://developer.cdn.mozilla.net/media/img/mdn-logo-sm.png" alt="An awesome picture">
<figcaption>Caption for the awesome picture</figcaption>
</figure>
<!-- footer -->
<footer>
Some copyright info or perhaps some author info for an &lt;article&gt;?
</footer>
<!-- form -->
<form action="">
<label for="GET-name">Name:</label>
<input id="GET-name" type="text" name="name">
<input type="submit" value="Save">
</form>
<form action="" method="post">
<label for="POST-name">Name:</label>
<input id="POST-name" type="text" name="name">
<input type="submit" value="Save">
</form>
<form action="" method="post">
<fieldset>
<legend>Title</legend>
<input type="radio" name="radio" id="radio"> <label for="radio">Click me</label>
</fieldset>
</form>
<!-- headings -->
<h1>Heading level 1</h1>
<h2>Heading level 2</h2>
<h3>Heading level 3</h3>
<h4>Heading level 4</h4>
<h5>Heading level 5</h5>
<h6>Heading level 6</h6>
<h1>Heading elements</h1>
<h2>Summary</h2>
<p>Some text here...</p>
<h2>Examples</h2>
<h3>Example 1</h3>
<p>Some text here...</p>
<h3>Example 2</h3>
<p>Some text here...</p>
<h2>See also</h2>
<p>Some text here...</p>
<!-- header -->
<header>
Header
</header>
<!-- hr -->
<hr>
<!-- i -->
<i>Italic</i>
<!-- iframe -->
<base target="_blank" />
<iframe width="400" height="215" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"
src="https://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=es-419&amp;geocode=&amp;q=buenos+aires&amp;sll=37.0625,-95.677068&amp;sspn=38.638819,80.859375&amp;t=h&amp;ie=UTF8&amp;hq=&amp;hnear=Buenos+Aires,+Argentina&amp;z=11&amp;ll=-34.603723,-58.381593&amp;output=embed">
</iframe><br />
<small>
<a href="https://maps.google.com/maps?f=q&amp;source=embed&amp;hl=es-419&amp;geocode=&amp;q=buenos+aires&amp;sll=37.0625,-95.677068&amp;sspn=38.638819,80.859375&amp;t=h&amp;ie=UTF8&amp;hq=&amp;hnear=Buenos+Aires,+Argentina&amp;z=11&amp;ll=-34.603723,-58.381593"
style="color:#0000FF;text-align:left">
See bigger map
</a>
</small>
<!-- img -->
<img src="mdn-logo-sm.png" alt="MD Logo" />
<a href="https://developer.mozilla.org/"><img src="mdn-logo-sm.png" alt="MDN Logo" /> </a>
<img src="mdn-logo-sm.png" alt="MD Logo" srcset="mdn-logo-HD.png 2x, mdn-logo-small.png 15w, mdn-banner-HD.png 100w 2x" />
<!-- input -->
<input type="email" x-moz-errormessage="Please specify a valid email address.">
<form action="getform.php" method="get">
First name: <input type="text" name="first_name" /><br />
Last name: <input type="text" name="last_name" /><br />
E-mail: <input type="email" name="user_email" /><br />
<input type="submit" value="Submit" />
</form>
<input value="defalut" type="text" mozactionhint="next" name="sometext" />
<input value="defalut" type="button">
<input value="defalut" type="tel">
<input value="defalut" type="text">
<input value="defalut" type="time">
<input value="defalut" type="search">
<input value="defalut" type="week">
<input value="defalut" type="url">
<input value="defalut" type="submit">
<input value="defalut" type="reset">
<input value="defalut" type="range">
<input value="defalut" type="radio">
<input value="defalut" type="password">
<input value="defalut" type="month">
<input value="defalut" type="image">
<input value="defalut" type="date">
<input value="defalut" type="datetime">
<input value="defalut" type="datetime-local">
<input value="defalut" type="color">
<input value="defalut" type="checkbox">
<input value="defalut" type="file">
<input value="defalut">
<!-- ins -->
<ins>This text has been inserted</ins>
<!-- kbd -->
<p>Type the following in the Run dialog: <kbd>cmd</kbd><br />Then click the OK button.</p>
<p>Save the document by pressing <kbd><kbd>Ctrl</kbd>+<kbd>S</kbd></kbd></p>
<!-- keygen -->
<keygen name="name" challenge="challenge string" keytype="type" keyparams="pqg-params">
<!-- label -->
<label>Click me</label><input type="text" id="User" name="Name" />
<!-- li, ol, ul -->
<ol>
<li>first item</li>
<li>second item</li>
<li>third item</li>
</ol>
<ul>
<li>first item</li>
<li>second item</li>
<li>third item</li>
</ul>
<ul>
<li><ul>
<li><ul>
<li><ul>
<li><ul>
<li>first item</li>
<li>second item</li>
<li>third item</li>
</ul></li>
<li>second item</li>
<li>third item</li>
</ul></li>
<li>second item</li>
<li>third item</li>
</ul></li>
<li>second item</li>
<li>third item</li>
</ul></li>
<li>second item</li>
<li>third item</li>
</ul>
<ol>
<li><ol>
<li><ol>
<li><ol>
<li><ol>
<li><ol>
<li>first</li>
<li>second item</li>
<li>third item</li>
</ol></li>
<li>second item</li>
<li>third item</li>
</ol></li>
<li>second item</li>
<li>third item</li>
</ol></li>
<li>second item</li>
<li>third item</li>
</ol></li>
<li>second item</li>
<li>third item</li>
</ol></li>
<li>second item</li>
<li>third item</li>
</ol>
<!-- main -->
<main>
<h1>Apples</h1>
<p>The apple is the pomaceous fruit of the apple tree.</p>
<article>
<h2>Red Delicious</h2>
<p>These bright red apples are the most common found in many
supermarkets.</p>
<p>... </p>
<p>... </p>
</article>
<article>
<h2>Granny Smith</h2>
<p>These juicy, green apples make a great filling for
apple pies.</p>
<p>... </p>
<p>... </p>
</article>
</main>
<!-- mark -->
<p>The &lt;mark&gt; element is used to <mark>highlight</mark> text</p>
<!-- menu -->
<menu>
<li>
<button type="menu" value="File" menu="file-menu"></button>
<menu type="popup" id="file-menu">
<menuitem label="New..." onclick="newFile()"></menuitem>
<menuitem label="Save..." onclick="saveFile()"></menuitem>
</menu>
</li>
<li>
<button type="menu" value="Edit" menu="edit-menu"></button>
<menu type="popup" id="edit-menu">
<menuitem label="Cut..." onclick="cutEdit()"></menuitem>
<menuitem label="Copy..." onclick="copyEdit()"></menuitem>
<menuitem label="Paste..." onclick="pasteEdit()"></menuitem>
</menu>
</li>
</menu>
<!-- menuitem -->
<menuitem type="command" label="Save" icon="icons/save.png" onclick="save()">
<!-- meter -->
<p>Heat the oven to <meter min="200" max="500" value="350">350 degrees</meter>.</p>
<p>He got a <meter low="69" high="80" max="100" value="84">B</meter> on the exam.</p>
<!-- nav -->
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
<!-- object -->
<object data="move.swf" type="application/x-shockwave-flash"></object>
<object data="move.swf" type="application/x-shockwave-flash">
<param name="foo" value="bar">
</object>
<!-- optgroup -->
<select>
<optgroup label="Group 1">
<option>Option 1.1</option>
</optgroup>
<optgroup label="Group 2">
<option>Option 2.1</option>
<option>Option 2.2</option>
</optgroup>
<optgroup label="Group 3" disabled>
<option>Option 3.1</option>
<option>Option 3.2</option>
<option>Option 3.3</option>
</optgroup>
</select>
<!-- output -->
<form oninput="result.value=parseInt(a.value)+parseInt(b.value)">
<input type="range" name="b" value="50" /> +
<input type="number" name="a" value="10" /> =
<output name="result"></output>
</form>
<!-- pre -->
<pre>
body {
color:red;
}
</pre>
<!-- progress -->
<progress value="70" max="100">70 %</progress>
<!-- q -->
<p>Everytime Kenny is killed, Stan will announce
<q cite="http://en.wikipedia.org/wiki/Kenny_McCormick#Cultural_impact">
Oh my God, you/they killed Kenny!
</q>.
</p>
<!-- ruby -->
<ruby>
<rp>(</rp><rt>Kan</rt><rp>)</rp>
<rp>(</rp><rt>ji</rt><rp>)</rp>
</ruby>
<ruby>
<rt>Kan</rt>
<rt>ji</rt>
</ruby>
<!-- s -->
<s>Today's Special: Salmon</s>
<!-- samp -->
<p>Regular text. <samp>This is sample text.</samp> Regular text.</p>
<!-- section -->
<section>
<h1>Heading</h1>
<p>Bunch of awesome content</p>
</section>
<!-- select -->
<select name="select">
<option value="value1">Value 1</option>
<option value="value2" selected>Value 2</option>
<option value="value3">Value 3</option>
</select>
<select name="select">
<optgroup label="one">
<option value="value1">Value 1</option>
<option value="value2" selected>Value 2</option>
<option value="value3">Value 3</option>
</optgroup>
<option value="value3">Value 3</option>
<optgroup label="two">
<option value="value1">Value 1</option>
<option value="value2" selected>Value 2</option>
<option value="value3">Value 3</option>
</optgroup>
</select>
<!-- sub -->
<p>The chemical formula of water is H<sub>2</sub>O</p>
<!-- sup -->
<p>This text is <sup>superscripted</sup></p>
<!-- table -->
<p>Simple table with header</p>
<table>
<tr>
<th>First name</th>
<th>Last name</th>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
</tr>
<tr>
<td>Jane</td>
<td>Doe</td>
</tr>
</table>
<p>Table with thead, tfoot, and tbody</p>
<table>
<thead>
<tr>
<th>Header content 1</th>
<th>Header content 2</th>
</tr>
</thead>
<tfoot>
<tr>
<td>Footer content 1</td>
<td>Footer content 2</td>
</tr>
</tfoot>
<tbody>
<tr>
<td>Body content 1</td>
<td>Body content 2</td>
</tr>
</tbody>
</table>
<p>Table with colgroup</p>
<table>
<colgroup span="4" class="columns"></colgroup>
<tr>
<th>Countries</th>
<th>Capitals</th>
<th>Population</th>
<th>Language</th>
</tr>
<tr>
<td>USA</td>
<td>Washington D.C.</td>
<td>309 million</td>
<td>English</td>
</tr>
<tr>
<td>Sweden</td>
<td>Stockholm</td>
<td>9 million</td>
<td>Swedish</td>
</tr>
</table>
<p>Table with colgroup and col</p>
<table>
<colgroup>
<col class="column1">
<col class="columns2plus3" span="2">
</colgroup>
<tr>
<th>Lime</th>
<th>Lemon</th>
<th>Orange</th>
</tr>
<tr>
<td>Green</td>
<td>Yellow</td>
<td>Orange</td>
</tr>
</table>
<p>Simple table with caption</p>
<table>
<caption>Awesome caption</caption>
<tr>
<td>Awesome data</td>
</tr>
</table>
<!-- template -->
<table id="producttable">
<thead>
<tr>
<td>UPC_Code</td>
<td>Product_Name</td>
</tr>
</thead>
<tbody>
<!-- existing data could optionally be included here -->
</tbody>
</table>
<template id="productrow">
<tr>
<td class="record"></td>
<td></td>
</tr>
</template>
<!-- textarea -->
<textarea name="textarea" rows="10" cols="50">Write something here</textarea>
<!-- time -->
<p>The concert starts at <time>20:00</time>.</p>
<p>The concert took place on <time datetime="2001-05-15 19:00">May 15</time>.</p>
<!-- track -->
<video controls>
<source src="sample.ogv" type="video/ogv">
<track kind="captions" src="sampleCaptions.srt" srclang="en">
<track kind="descriptions" src="sampleDesciptions.srt" srclang="en">
<track kind="chapters" src="sampleChapters.srt" srclang="en">
<track kind="subtitles" src="sampleSubtitles_de.srt" srclang="de">
<track kind="subtitles" src="sampleSubtitles_en.srt" srclang="en">
<track kind="subtitles" src="sampleSubtitles_ja.srt" srclang="ja">
<track kind="subtitles" src="sampleSubtitles_oz.srt" srclang="oz">
<track kind="metadata" src="keyStage1.srt" srclang="en" label="Key Stage 1">
<track kind="metadata" src="keyStage2.srt" srclang="en" label="Key Stage 2">
<track kind="metadata" src="keyStage3.srt" srclang="en" label="Key Stage 3">
</video>
<!-- var -->
<p> A simple equation: <var>x</var> = <var>y</var> + 2 </p>
<!-- video -->
<video src="videofile.ogg" autoplay poster="posterimage.jpg">
Sorry, your browser doesn't support embedded videos,
but don't worry, you can <a href="videofile.ogg">download it</a>
and watch it with your favorite video player!
</video>
<video src="foo.ogg">
<track kind="subtitles" src="foo.en.vtt" srclang="en" label="English">
<track kind="subtitles" src="foo.sv.vtt" srclang="sv" label="Svenska">
</video>
<!-- wbr -->
<p>http://this<wbr>.is<wbr>.a<wbr>.really<wbr>.long<wbr>.example<wbr>.com/With<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages</p>
```
\ No newline at end of file
// generic methods
public <T> List<T> fromArrayToList(T[] a) {
return Arrays.stream(a).collect(Collectors.toList());
}
public static <T, G> List<G> fromArrayToList(T[] a, Function<T, G> mapperFunction) {
return Arrays.stream(a)
.map(mapperFunction)
.collect(Collectors.toList());
}
// bounded generics
public <T extends Number> List<T> fromArrayToList(T[] a) {
...
}
//multiple bounds
<T extends Number & Comparable>
// upper bound wildcards
public static void paintAllBuildings(List<? extends Building> buildings) {
...
}
// lower bound wildcard
<? super T>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment