|
| 1 | +## Contributing |
| 2 | + |
| 3 | +_TBD_ (see [issue #4] for discussion) |
| 4 | + |
| 5 | +### General Workflow |
| 6 | + |
| 7 | +1. [Fork the repository](https://github.com/idris-hackers/software-foundations/fork) if you haven't already. |
| 8 | +1. Check the [open pull requests](https://github.com/idris-hackers/software-foundations/pulls) for any related work in progress (WIP). |
| 9 | +1. Check out a new branch based on `develop`. |
| 10 | +1. Push some commits to your fork. |
| 11 | + - The general workflow here is as follows: |
| 12 | + - Copy/paste the original text, [reformatting](#formatting) as |
| 13 | + appropriate. |
| 14 | + - Translate Coq code into (idiomatic) Idris. |
| 15 | + - Edit, augment and delete text as appropriate. |
| 16 | + _N.B. This can be done in subsequent pull requests._ |
| 17 | +1. Open a pull request (as soon as possible). |
| 18 | + - If it's not ready to be merged, but you want to _claim_ a particular task, |
| 19 | + prefix the pull request with `WIP:`. |
| 20 | + - Make a comment and remove the `WIP:` when it's ready to be reviewed and |
| 21 | + merged. _Remember: formatting the text and taking a first pass at |
| 22 | + translating the Coq to Idris is enough for an initial pull request._ |
| 23 | +1. Open subsequent pull requests following a similar pattern for and edits or |
| 24 | + other updates |
| 25 | + |
| 26 | +The `develop` branch is the _working branch_ and `master` is for _releases_, |
| 27 | +i.e. rebuilt [PDF]s and [website](https://idris-hackers.github.io/software-foundations) updates. |
| 28 | + |
| 29 | + |
| 30 | +### Formatting |
| 31 | + |
| 32 | +When formatting the [Literate Idris] source, we use [bird tracks] for code meant |
| 33 | +to be compiled and a combination of [Markdown] and [LaTeX] for commentary and |
| 34 | +illustrative examples that aren't meant to be compiled. |
| 35 | + |
| 36 | +````markdown |
| 37 | += Example |
| 38 | + |
| 39 | +This is some commentary with **bold** and _italicized_ text. |
| 40 | + |
| 41 | +```idris |
| 42 | +-- This is an Idris code block which won't be read when compiling the file. |
| 43 | +foo : Nat |
| 44 | +foo = 42 |
| 45 | +``` |
| 46 | + |
| 47 | + |
| 48 | +== Code to Compile |
| 49 | + |
| 50 | +The following, however, will be compiled: |
| 51 | + |
| 52 | +> module Example |
| 53 | +> |
| 54 | +> %access public export |
| 55 | +> |
| 56 | +> foo : String |
| 57 | +> foo = "bar" |
| 58 | + |
| 59 | + |
| 60 | +== Other Notes |
| 61 | + |
| 62 | +- We can also highlight code inline, e.g. \idr{primes : Inf (List Nat)}. |
| 63 | +- To refer to glossary entries, use e.g. \mintinline[]{latex}{\gls{term}}. |
| 64 | +```` |
| 65 | + |
| 66 | +#### Chapters, Sections, et al. |
| 67 | + |
| 68 | +To denote chapters, sections, and other subdivisions, use `=` as follows: |
| 69 | + |
| 70 | +```markdown |
| 71 | += Chapter |
| 72 | +== Section |
| 73 | +=== Subsection |
| 74 | +==== Subsubsection |
| 75 | +``` |
| 76 | + |
| 77 | +#### Bold and Italicized Text |
| 78 | + |
| 79 | +We use the succinct Markdown syntax... |
| 80 | + |
| 81 | +```markdown |
| 82 | +... to format **bold** and _italicized_ text. |
| 83 | +``` |
| 84 | + |
| 85 | +#### Lists |
| 86 | + |
| 87 | +We prefer the Markdown syntax here too, e.g. |
| 88 | + |
| 89 | +```markdown |
| 90 | +- foo |
| 91 | +- bar |
| 92 | +- baz |
| 93 | +``` |
| 94 | + |
| 95 | +#### Code Blocks |
| 96 | + |
| 97 | +Just as with bold and italicized text, we favor the more succinct Markdown |
| 98 | +syntax for (fenced) code blocks: |
| 99 | + |
| 100 | +````markdown |
| 101 | +```idris |
| 102 | +addTwo : Nat -> Nat |
| 103 | +addTwo x = x + 2 |
| 104 | +``` |
| 105 | +```` |
| 106 | + |
| 107 | +For more information, refer to [the relevant GitHub Help document][gfm code blocks]. |
| 108 | + |
| 109 | +#### Inline Code |
| 110 | + |
| 111 | +For inline Idris code, use the custom `\mintinline` shortcut `\idr`, e.g. |
| 112 | + |
| 113 | +```tex |
| 114 | +To print ``Hello World!'' in Idris, write \idr{putStrLn "Hello, World!"}. |
| 115 | +``` |
| 116 | + |
| 117 | +For convenience, we've also defined the shortcut `\el` for inline Emacs Lisp |
| 118 | +code, e.g. |
| 119 | + |
| 120 | +```latex |
| 121 | +Set the value of \el{foo} to \el{42}: \el{(setq foo 42)}. |
| 122 | +``` |
| 123 | + |
| 124 | +Otherwise, use single backticks for inline monospace text, e.g. |
| 125 | + |
| 126 | +``` |
| 127 | +This is some `inline monospaced text`. |
| 128 | +``` |
| 129 | + |
| 130 | +In a certain cases, we might want syntax highlighting for a language other than |
| 131 | +Idris or Emacs Lisp. For such cases, use the standard `\mintinline` command, |
| 132 | +e.g. |
| 133 | + |
| 134 | +```tex |
| 135 | +To declare a theorem in Coq, use \mintinline[]{coq}{Theorem}. |
| 136 | +``` |
| 137 | + |
| 138 | +#### Glossary |
| 139 | + |
| 140 | +We use the [glossaries package] for defining terms |
| 141 | +(in [`src/glossary.tex`][glossary.tex]) and including a glossary in |
| 142 | +the [generated PDF][PDF]. See the package documentation for more information, |
| 143 | +but here's a quick example: |
| 144 | + |
| 145 | +```tex |
| 146 | +What is the \gls{meaning of life}? |
| 147 | +
|
| 148 | +
|
| 149 | +\newglossaryentry{meaning of life}{ |
| 150 | + description={42} |
| 151 | +} |
| 152 | +``` |
| 153 | + |
| 154 | + |
| 155 | +### Generating the PDF |
| 156 | + |
| 157 | +To generate the [PDF] we use [Pandoc] and [latexmk]. For more details, check out |
| 158 | +the `all.pdf`, `all.tex` and `%.tex` rules in [`src/Makefile`]. |
| 159 | + |
| 160 | + |
| 161 | +<!-- Named Links --> |
| 162 | + |
| 163 | +[issue #4]: https://github.com/idris-hackers/software-foundations/issues/4 |
| 164 | +[Literate Idris]: http://docs.idris-lang.org/en/latest/tutorial/miscellany.html#literate-programming |
| 165 | +[bird tracks]: https://wiki.haskell.org/Literate_programming#Bird_Style |
| 166 | +[Markdown]: https://daringfireball.net/projects/markdown/ |
| 167 | +[LaTeX]: http://www.latex-project.org |
| 168 | +[gfm code blocks]: https://help.github.com/articles/creating-and-highlighting-code-blocks/ |
| 169 | +[glossaries package]: https://www.ctan.org/pkg/glossaries |
| 170 | +[glossary.tex]: https://github.com/idris-hackers/software-foundations/blob/master/src/glossary.tex |
| 171 | +[`src/Makefile`]: https://github.com/idris-hackers/software-foundations/blob/master/src/glossary.tex |
| 172 | +[PDF]: https://idris-hackers.github.io/software-foundations/pdf/sf-idris-2016.pdf |
| 173 | +[Pandoc]: http://pandoc.org |
| 174 | +[latexmk]: https://www.ctan.org/pkg/latexmk/ |
0 commit comments