fix #9647 tmpl=>nimf (#9658)

This commit is contained in:
Timothee Cour 2018-11-13 23:27:48 -08:00 • committed by Andreas Rumpf
commit b5448bf25c
15 changed files with 23 additions and 15 deletions

View file

@ -88,6 +88,11 @@ proc enumToString*(enums: openArray[enum]): string =
### Language changes ### Language changes
- The standard extension for SCF (source code filters) files was changed from
``.tmpl`` to ``.nimf``,
it's more recognizable and allows tools like github to recognize it as Nim,
see [#9647](https://github.com/nim-lang/Nim/issues/9647).
The previous extension will continue to work.
### Tool changes ### Tool changes
- `jsondoc` now include a `moduleDescription` field with the module - `jsondoc` now include a `moduleDescription` field with the module

View file

@ -31,13 +31,16 @@ Usage
===== =====
First, put your SCF code in a separate file with filters specified in the first line. First, put your SCF code in a separate file with filters specified in the first line.
**Note:** You can name your SCF file with any file extension you want, but the conventional extension is ``.tmpl``. **Note:** You can name your SCF file with any file extension you want, but the
conventional extension is ``.nimf``
(it used to be ``.tmpl`` but that was too generic, for example preventing github to
recognize it as Nim source file).
If we use `generateXML` code shown above and call the SCF file `xmlGen.tmpl` If we use `generateXML` code shown above and call the SCF file `xmlGen.nimf`
In your `main.nim`: In your `main.nim`:
.. code-block:: nim .. code-block:: nim
include "xmlGen.tmpl" include "xmlGen.nimf"
echo generateXML("John Smith","42") echo generateXML("John Smith","42")

View file

@ -31,7 +31,7 @@ Path Purpose
reStructuredText files reStructuredText files
``lib`` the Nim library ``lib`` the Nim library
``web`` website of Nim; generated by ``nimweb`` ``web`` website of Nim; generated by ``nimweb``
from the ``*.txt`` and ``*.tmpl`` files from the ``*.txt`` and ``*.nimf`` files
============ =================================================== ============ ===================================================

View file

@ -180,7 +180,7 @@ block symchoicefield:
import os, times import os, times
include "sunset.tmpl" include "sunset.nimf"
block ttempl: block ttempl:
const const
tabs = [["home", "index"], tabs = [["home", "index"],

View file

@ -1,7 +1,7 @@
#? stdtmpl(subsChar='?') | standard #? stdtmpl(subsChar='?') | standard
#proc generateBuildShellScript(c: ConfigData): string = #proc generateBuildShellScript(c: ConfigData): string =
# result = "#! /bin/sh\n# Generated from niminst\n" & # result = "#! /bin/sh\n# Generated from niminst\n" &
# "# Template is in tools/niminst/buildsh.tmpl\n" & # "# Template is in tools/niminst/buildsh.nimf\n" &
# "# To regenerate run ``niminst csource`` or ``koch csource``\n" # "# To regenerate run ``niminst csource`` or ``koch csource``\n"
set -e set -e

View file

@ -1,7 +1,7 @@
#? stdtmpl(subsChar='?') | standard #? stdtmpl(subsChar='?') | standard
#proc generateMakefile(c: ConfigData): string = #proc generateMakefile(c: ConfigData): string =
# result = "# Generated from niminst\n" & # result = "# Generated from niminst\n" &
# "# Template is in tools/niminst/makefile.tmpl\n" & # "# Template is in tools/niminst/makefile.nimf\n" &
# "# To regenerate run ``niminst csource`` or ``koch csource``\n" # "# To regenerate run ``niminst csource`` or ``koch csource``\n"
CC ??= gcc CC ??= gcc

View file

@ -126,13 +126,13 @@ proc skipRoot(f: string): string =
inc i inc i
if result.len == 0: result = f if result.len == 0: result = f
include "inno.tmpl" include "inno.nimf"
include "nsis.tmpl" include "nsis.nimf"
include "buildsh.tmpl" include "buildsh.nimf"
include "makefile.tmpl" include "makefile.nimf"
include "buildbat.tmpl" include "buildbat.nimf"
include "install.tmpl" include "install.nimf"
include "deinstall.tmpl" include "deinstall.nimf"
# ------------------------- configuration file ------------------------------- # ------------------------- configuration file -------------------------------

View file

@ -71,7 +71,7 @@ proc initConfigData(c: var TConfigData) =
c.gitCommit = output.strip c.gitCommit = output.strip
c.quotations = initTable[string, tuple[quote, author: string]]() c.quotations = initTable[string, tuple[quote, author: string]]()
include "website.tmpl" include "website.nimf"
# ------------------------- configuration file ------------------------------- # ------------------------- configuration file -------------------------------