commit 46c344605573d02bf0884610d779fa33644bb7e9
parent 9327772128bae1733a71254a8f66b123475cedd9
Author: finwo <finwo@pm.me>
Date: Tue, 30 Oct 2018 10:21:58 +0100
Merge pull request #2 from trackthis/spec-compiler
Spec compiler
Diffstat:
11 files changed, 354 insertions(+), 8 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -1,5 +1,13 @@
-# Created by https://www.gitignore.io/api/osx,linux,windows,intellij
+# Created by https://www.gitignore.io/api/osx,linux,windows,intellij,composer
+
+### Composer ###
+composer.phar
+/vendor/
+
+# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
+# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
+# composer.lock
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
@@ -12,6 +20,9 @@
.idea/**/dictionaries
.idea/**/shelf
+# Generated files
+.idea/**/contentModel.xml
+
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
@@ -143,6 +154,11 @@ $RECYCLE.BIN/
*.lnk
-# End of https://www.gitignore.io/api/osx,linux,windows,intellij
+# End of https://www.gitignore.io/api/osx,linux,windows,intellij,composer
/.gtm/
/.idea/
+composer.lock
+src/*/*.pdf
+*.aux
+*.log
+*.toc
diff --git a/README.md b/README.md
@@ -15,5 +15,6 @@ their own requirements.
### Table of contents
-- [SPEC0000](spec/spec0000.txt) Specification Format
-- [SPEC0001](spec/spec0001.txt) Javascript Styling
+- [SPEC0000](spec/0000.txt) Specification Format
+- [SPEC0001](spec/0001.txt) Javascript Styling
+- [SPEC0002](spec/0002.pdf) Ratus Unilicense
diff --git a/build.sh b/build.sh
@@ -1,6 +1,28 @@
#!/usr/bin/env bash
-# Update the .gitignore file
-curl -s https://www.gitignore.io/api/osx,linux,windows,intellij > .gitignore
-echo /.gtm/ >> .gitignore
-echo /.idea/ >> .gitignore
+#echo "Updating gitignore"
+#curl -s https://www.gitignore.io/api/osx,linux,windows,intellij,composer > .gitignore
+#echo /.gtm/ >> .gitignore
+#echo /.idea/ >> .gitignore
+#echo composer.lock >> .gitignore
+#echo 'src/*/*.pdf' >> .gitignore
+#echo '*.aux' >> .gitignore
+#echo '*.log' >> .gitignore
+#echo '*.toc' >> .gitignore
+#
+#echo "Updating PHP dependencies"
+#composer install &>/dev/null
+
+echo "(Re)building generated specs"
+ORGDIR=$(pwd)
+SPECDIR=$(pwd)/spec
+cd src
+for f in $(find . -type f -regextype posix-egrep -regex '\./[0-9]{4}.*\.tex'); do
+ pdflatex ${f}
+ pdflatex ${f}
+ cp ${f%.*}.pdf ${SPECDIR}
+ rm -f *.pdf
+ rm -f *.aux
+ rm -f *.log
+ rm -f *.toc
+done
diff --git a/composer.json b/composer.json
@@ -0,0 +1,15 @@
+{
+ "name": "ratus/specifications",
+ "require": {
+ "finwo/property-accessor": "^0.1.4",
+ "erusev/parsedown": "^1.7"
+ },
+ "license": "CC-By 4.0",
+ "authors": [
+ {
+ "name": "Robin Bron",
+ "email": "robin@finwo.nl"
+ }
+ ],
+ "minimum-stability": "stable"
+}
diff --git a/spec/spec0000.txt b/spec/0000.txt
diff --git a/spec/spec0001.txt b/spec/0001.txt
diff --git a/spec/0002.pdf b/spec/0002.pdf
Binary files differ.
diff --git a/src/0000.md b/src/0000.md
@@ -0,0 +1,137 @@
+Date: 2018-08-15
+author: Robin Bron <robin@finwo.nl>
+organization: Ratus B.V.
+title: Specification Format
+
+# Convections:
+
+<RFC2119
+
+# Character encoding
+
+Plain-text files for specifications MUST use the `CP437` standard with the
+exclusion of character code 0x0A which represents a line feed as specified in
+`RFC20`.
+
+# Line definition
+
+A line of text is a sequence of 0 or more characters followed by a line feed
+character. For the sake of and clarity, the ending line feed character is
+part of the line.
+
+Lines MUST NOT exceed 72 characters in length, including the ending line feed
+character. A line is called a blank line if it consists of only a line feed
+character.
+
+# Line numbering
+
+To ensure the following page dimension section is clear, we need to define
+how lines are numbered.
+
+Assuming a document is in digital format and has a length of greater than
+0 bytes, the first character in the document is part of line 0. Numbering
+lines from 0 instead of 1 gives us an advantage of clarity in the next
+section.
+
+# Pages
+
+A page is a sequence of 60 lines. That means for every line number n, the
+line is the start of a new page when $$ n mod 60 = 0 $$.
+
+## Page header
+
+The first line of a page SHOULD consist of a left-aligned spec number
+indicator, a centered (short) document title and a right-aligned publishing
+date (see [Document header][document header]). The second line of a page MUST
+always be blank, excluding the first page of the document.
+
+## Page footer
+
+The last line of a page MUST consist of a left-align last name of the author
+and a right-aligned page number between square brackets. The second-to-last
+line of a page must be blank, just like the second line of a page.
+
+# Paragraphs
+
+A paragraph is a sequence of consecutive lines containing characters other
+than only a line feed. Paragraphs are separated by either a blank line or a
+page break. Paragraphs MUST NOT span multiple pages, limiting their size to
+56 lines.
+
+# Document header
+
+The first lines of the first page of a specification document SHALL always
+contain left-aligned description headers (see
+[Descriptive header][descriptive header]) and right-aligned author
+identification and a right-aligned publishing date.
+
+After the initial lines (see [Descriptive header][descriptive header] through
+[Publish date][publish date]), the document title is REQUIRED to be written
+on the first page of the document. For it's specification, see section
+[document title][document title].
+
+Further information on the first page should give a quick description of the
+contents of the document.
+
+## Descriptive header
+
+Each descriptive header is made up of a key and a value. Whitespace is not
+allowed in both the key and the value. Whitespace can only be included in the
+value by wrapping the value in quote characters.
+
+The key of the header consists of all characters of the line up to the first
+semicolon, excluding the semicolon itself and omitting all white-space
+characters.
+
+The value of the header starts at the first non-whitespace character after
+the first semicolon of the line. If the first character is a quote, the value
+ends at the next quote in the line. If the first character is not a quote,
+the value ends at the next whitespace character.
+
+## Short author identification
+
+In order to allow authors to take some credit and to track who has written
+what, the author's name MUST be added right-aligned on the first line of the
+first page of the document. To prevent mixing notations between documents,
+the names SHOULD be written as only the first letters of all given names in
+capitals, separated by dots, a space and the Family name starting with a
+capital. When written by a group with a name, the short author identification
+string SHOULD state the group's name.
+
+## Publish date
+
+Because a document is unlikely to have been written within a day, a publish
+date is simply the month's name starting with a capital followed by the year,
+both following the Gregorian calendar.
+
+# Document footer
+
+The document SHOULD close, starting on a new page, with all informative
+resources which were used to write the document, noting their keyword and
+document title. When possible, a URL to the resource SHOULD be included.
+
+After the informative resources, the document SHOULD end with one or several
+pages dedicated to the information of the author(s) and if possible their
+contact information.
+
+# Section titles
+
+Section titles SHOULD be a short text about the subject the section
+describes. Whether it is simply the keyword of what it explains, a problem
+statement or other type of text is up to the author as long as it's relevant
+to the section's body.
+
+A section title MUST start with a capital character & MUST NOT contain any
+other capital letters, excluding where they are required in names or
+abbreviations.
+
+# Document title
+
+The title of the document should clearly state the main subject of the
+document and it's contents. Each word of the document title must start with a
+capital character when noted as the title of the document.
+
+On the first page of the document, the title should be centered horizontally
+and have at least 2 blank lines both above and below it. The document title
+SHOULD be as close to the document's descriptive headers as possible.
+
diff --git a/src/0002.tex b/src/0002.tex
@@ -0,0 +1,142 @@
+\documentclass[a4paper,11pt]{article}
+\pagenumbering{arabic}
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+\usepackage{listings}
+\usepackage{lmodern}
+\usepackage{xcolor}
+\usepackage{xparse}
+
+\NewDocumentCommand{\codeword}{v}{%
+\texttt{\textcolor{blue}{#1}}%
+}
+
+\lstset{language=C,keywordstyle={\bfseries \color{blue}}}
+
+\begin{document}
+
+\title{Ratus Unilicense 1.0}
+\author{Robin Bron}
+\date{\today}
+\maketitle
+
+\vfill
+
+\input{cc40.tex}
+\newpage
+\tableofcontents
+\newpage
+
+\section{Introduction}
+ This document specifies the Ratus Unilicense 1.0 license, targeted at
+ providing a restrictive code license for both open source and closed source
+ projects while still allowing unrestricted use of the licensed subject.
+
+\subsection{Summary}
+ \begin{itemize}
+ \item Must
+ \begin{itemize}
+ \item Include License
+ \end{itemize}
+ \item Can
+ \begin{itemize}
+ \item Change license
+ \item Sublicense
+ \item Private use
+ \item Commercial use
+ \item Include original
+ \end{itemize}
+ \item Limited
+ \begin{itemize}
+ \item Distribute
+ \item Modify
+ \end{itemize}
+ \item Can't
+ \begin{itemize}
+ \item Hold Liable
+ \end{itemize}
+ \end{itemize}
+
+\subsection{Conventions}
+\input{rfc2119.tex}
+
+\newpage
+\section{The License}
+
+\subsection{Inside a file}
+ Ratus Unilicense 1.0 MAY be applied to a single file or document using the
+ following text near the start of the file or document, replacing \{name\} by
+ the name of the entity holding the rights (most likely your or your company's
+ name).
+
+ \begin{quote}
+ Copyright (C) \{name\} - All Rights Reserved\newline
+ Ratus Unilicense 1.0
+
+ % Disallow spreading like wildfire
+ Unauthorized copying, modifying or distribution of this file or document,
+ it's derivatives and associated documentation files and/or documents, via
+ any medium, is strictly prohibited without the express permission of the
+ copyright holder.
+
+ % Apply all rules from the full version
+ All but section 1 of Ratus Unilicense 1.0 apply to this file or
+ document (the "Software"), as found following the url:
+ https://trackthis.nl/license/ratus-unilicense-1.0
+ \end{quote}
+
+\newpage
+\subsection{Full Version}
+ Ratus Unilicense 1.0 SHOULD be applied to a collection of files or documents
+ using a single \codeword{LICENSE} file or document in the folder or container
+ which holds the files or documents licensed by it.
+
+ To apply Ratus Unilicense 1.0 to the contents of a folder or container, the
+ contents of the \codeword{LICENSE} file or document MUST be as follows,
+ replacing \{name\} by the name of the entity holding the rights (most likely
+ your or your company's name).
+
+ \begin{quote}
+ Copyright (C) \{name\} - All Rights Reserved\newline
+ Ratus Unilicense 1.0
+
+ % Disallow spreading like wildfire
+ 1. Copyright\newline
+ Unauthorized copying, modifying or distribution of the files and/or
+ documents contained in the folder or container holding this license,
+ their derivatives and associated files and/or documents (the "Software"),
+ via any medium, is strictly prohibited without the express permission of
+ the copyright holder.
+
+ % Allow compile & run
+ 2. Compilation and execution\newline
+ Obtained copies of the Software may be compiled and/or executed without
+ modification without limitations and warranties.
+
+ % Allow full relicensing by copyright holder
+ 3. Changing license\newline
+ The Software may be distributed under a different license only by the
+ copyright holder at which point only the newer license applies to all
+ copies of the Software obtained using that license.
+
+ % Allow example code to be copied
+ 4. Sublicense\newline
+ The copyright holder may apply a different license to any, whole or
+ partial, file, document, folder or container covered by this license.
+
+ % Waive warranties
+ 5. Liability\newline
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF FITNESS FOR A
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 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.
+
+ \end{quote}
+
+
+%\subsection{Full Version}
+
+\end{document}
diff --git a/src/cc40.tex b/src/cc40.tex
@@ -0,0 +1,9 @@
+\begin{flushleft}
+Copyright Notice
+\newline
+\newline
+This document is licensed under a Creative Commons Attribution 4.0 International License
+\newline
+\newline
+You should have received a copy of the license along with this work. If not, see <http://creativecommons.org/licenses/by/4.0/>
+\end{flushleft}
diff --git a/src/rfc2119.tex b/src/rfc2119.tex
@@ -0,0 +1,4 @@
+The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
+"SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this
+document are to be interpreted as described in \codeword{RFC2119} when, and
+only when, they appear in all capitals, as shown here.