Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: getnikola/nikola
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a97770d06870^
Choose a base ref
...
head repository: getnikola/nikola
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7a97475e37a1
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Dec 24, 2015

  1. Copy the full SHA
    a97770d View commit details
  2. jinjify builtin shortcodes

    ralsina committed Dec 24, 2015
    Copy the full SHA
    7a97475 View commit details
Showing with 15 additions and 0 deletions.
  1. +1 −0 nikola/data/shortcodes/mako/raw.tmpl
  2. +14 −0 scripts/jinjify.py
1 change: 1 addition & 0 deletions nikola/data/shortcodes/mako/raw.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${data}
14 changes: 14 additions & 0 deletions scripts/jinjify.py
Original file line number Diff line number Diff line change
@@ -216,6 +216,19 @@ def mako2jinja(input_file):

return output


def jinjify_shortcodes(in_dir, out_dir):
for fname in os.listdir(in_dir):
if not fname.endswith('.tmpl'):
continue
in_file = os.path.join(in_dir, fname)
out_file = os.path.join(out_dir, fname)
with open(in_file) as inf:
data = mako2jinja(inf)
with open(out_file, 'w') as outf:
outf.write(data)


if __name__ == "__main__":
if len(sys.argv) == 1:
print('Performing standard conversions:')
@@ -225,6 +238,7 @@ def mako2jinja(input_file):
):
print(' {0} -> {1}'.format(m, j))
jinjify(m, j)
jinjify_shortcodes('nikola/data/shortcodes/mako', 'nikola/data/shortcodes/jinja')
elif len(sys.argv) != 3:
print('ERROR: needs input and output directory, or no arguments for default conversions.')
else: