trying to get this stupid build working

This commit is contained in:
Anish Lakhwara 2022-03-25 02:01:43 +10:00
parent 3227771f7e
commit 0cc472876f
6 changed files with 16 additions and 22 deletions

View file

@ -283,6 +283,7 @@ def replacement_function(replace):
if replace == 'name-generation': if replace == 'name-generation':
# TODO gross hardcoded # TODO gross hardcoded
lines = [] lines = []
# this file should probably be an asset??
with open('raw/210124-0033.wiki') as f: with open('raw/210124-0033.wiki') as f:
lines = f.readlines() lines = f.readlines()
lines = lines[-2:] lines = lines[-2:]
@ -513,7 +514,6 @@ def create_home_page(template, site_folder):
return template return template
# Create RSS Feed
def create_rss_feed(rss_entries, rss_template, rss_item_template, site_folder): def create_rss_feed(rss_entries, rss_template, rss_item_template, site_folder):
template = open(rss_template, 'r').read() template = open(rss_template, 'r').read()
itemTemplate = open(rss_item_template, 'r').read() itemTemplate = open(rss_item_template, 'r').read()

View file

@ -5,8 +5,8 @@
# censor - burn all mentions of this word wherever it appears in Kitaab # censor - burn all mentions of this word wherever it appears in Kitaab
# filter - leave names in tact but do not link to relevant documents # filter - leave names in tact but do not link to relevant documents
# create - list in an index file for website # create - list in an index file for website
from shared.censor import privateList
from shared import TagHelper, config, helpers from shared import TagHelper, config, helpers
import shared.censor
from os import listdir, mkdir, path, remove from os import listdir, mkdir, path, remove
import shutil import shutil
from . import convert from . import convert
@ -14,7 +14,7 @@ import os
# TODO: generalize based on headings(?) in index.wiki # TODO: generalize based on headings(?) in index.wiki
censor = privateList censor = shared.censor.privateList
# TODO put this in config too... # TODO put this in config too...
filter = ["dream", "gratitude", "review", "jrnl", "work", "job", "debt", filter = ["dream", "gratitude", "review", "jrnl", "work", "job", "debt",
"people", "priv", "threatdefence", "info"] "people", "priv", "threatdefence", "info"]

View file

@ -1,9 +1,9 @@
import json import json
import random import random
from shared import helpers from shared import helpers
from shared.censor import privateList import shared.censor
censor = privateList censor = shared.censor.privateList
def loadNetwork(path='network.json'): def loadNetwork(path='network.json'):

View file

@ -1,31 +1,25 @@
from grab import makePublic import grab.kitaab
from shared import TagHelper from shared import TagHelper
from build import build import build.kitaab
import os
def grab(): def get_raw_files():
# We're in src/kitaab-public/
os.chdir('./grab/')
all_files = TagHelper.getAllFiles() all_files = TagHelper.getAllFiles()
filtered_files = makePublic.filterFiles(all_files) filtered_files = grab.kitaab.filterFiles(all_files)
makePublic.copyFiles(filtered_files) grab.kitaab.copyFiles(filtered_files)
print("Censoring files...") print("Censoring files...")
makePublic.censorFiles() grab.kitaab.censorFiles()
def build_website(): def build_website():
# we're in src/kitaab-public/grab/
os.chdir('../')
print('building websites') print('building websites')
build.generate_website() build.kitaab.generate_website()
def main(): def main():
grab() get_raw_files()
build_website() build_website()
if __name__ == '__main__': if __name__ == '__main__':
os.chdir('./src/kitaab-public/')
main() main()

View file

@ -2,11 +2,11 @@ from ctags import CTags, TagEntry
import sys import sys
from icecream import ic from icecream import ic
from os import listdir, path from os import listdir, path
from shared.censor import privateList import shared.censor
# TODO don't hardcode the path # TODO don't hardcode the path
censor = privateList censor = shared.censor.privateList
def getAllFiles(): def getAllFiles():

View file

@ -5,7 +5,7 @@ relative_build_url = ""
absolute_build_url = "https://anish.lakhwara.com/" absolute_build_url = "https://anish.lakhwara.com/"
files_folder = '' # TODO files_folder = '' # TODO
build_folder = "output/" build_folder = "output/"
assets_folder = "asset/" assets_folder = "assets/"
medias_folder = "media/" medias_folder = "media/"
raw_folder = "raw/" raw_folder = "raw/"
template_main = "build/partial/main.html" template_main = "build/partial/main.html"