diff options
| author | Lucas Fryzek <lucas.fryzek@fryzekconcepts.com> | 2024-08-21 23:21:39 +0100 | 
|---|---|---|
| committer | Lucas Fryzek <lucas.fryzek@fryzekconcepts.com> | 2024-08-21 23:21:39 +0100 | 
| commit | 15d890c7c57f7cce8a84a90d639ab8b86959be62 (patch) | |
| tree | f52771581927d42b151f72381d4d75c1dcd461d5 /tools | |
| parent | 31d83c2ad43fd562e2fb57fa8eb0acd87d0dc9a1 (diff) | |
build: switch to using meson
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/meta_tools.lua | 3 | ||||
| -rwxr-xr-x | tools/rss_gen.py | 18 | 
2 files changed, 13 insertions, 8 deletions
| diff --git a/tools/meta_tools.lua b/tools/meta_tools.lua index 006e156..3687a27 100644 --- a/tools/meta_tools.lua +++ b/tools/meta_tools.lua @@ -33,7 +33,8 @@ function meta_tools.write_link_file(name, links)  end  function meta_tools.get_note(note_name) -    local file = io.open(string.format("build/%s.meta", note_name), "r") +    local build_root = PANDOC_WRITER_OPTIONS.variables["build_root"] +    local file = io.open(string.format("%s/%s.meta", build_root, note_name), "r")      local note = {}      for line in file:lines() do diff --git a/tools/rss_gen.py b/tools/rss_gen.py index f2b55c7..c3f74ad 100755 --- a/tools/rss_gen.py +++ b/tools/rss_gen.py @@ -25,7 +25,8 @@ ET.SubElement(channel, "lastBuildDate").text = today  notes = [] -build_dir = "./build" +source_dir = sys.argv[1] +build_dir = sys.argv[2]  for file in os.listdir(build_dir):      if file.endswith(".meta"):          path = os.path.join(build_dir, file) @@ -43,9 +44,9 @@ notes.sort(key=lambda note: datetime.datetime.strptime(note["date"], "%Y-%m-%d")  limit_cat = False  categories = [] -if len(sys.argv) >= 3: +if len(sys.argv) >= 5:      limit_cat = True -    categories = sys.argv[2:] +    categories = sys.argv[4:]  for note in notes:      if limit_cat: @@ -64,10 +65,13 @@ for note in notes:      ET.SubElement(item, "title").text = note["title"]      ET.SubElement(item, "link").text = post_url -      # Generate simple text version of post -    process = Popen(["pandoc", "--lua-filter=./tools/note.lua", "--highlight-style=pygments", -                     "./notes/{}.md".format(note["name"])], stdout=PIPE) +    process = Popen(["pandoc", +                     "--lua-filter={source}/tools/note.lua".format(source=source_dir), +                     "--highlight-style=pygments", +                     "{source}/notes/{note}.md".format(source=source_dir, note=note["name"]), +                     "-V", 'build_root={}'.format(build_dir)] +                    ,stdout=PIPE)      (output, err) = process.communicate()      exit_code = process.wait()      ET.SubElement(item, "description").text = output.decode() @@ -78,4 +82,4 @@ for note in notes:      ET.SubElement(item, "guid").text = post_url  tree = ET.ElementTree(rss) -tree.write(sys.argv[1], encoding='utf-8', xml_declaration=True) +tree.write(sys.argv[3], encoding='utf-8', xml_declaration=True) |