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':
# TODO gross hardcoded
lines = []
# this file should probably be an asset??
with open('raw/210124-0033.wiki') as f:
lines = f.readlines()
lines = lines[-2:]
@ -513,7 +514,6 @@ def create_home_page(template, site_folder):
return template
# Create RSS Feed
def create_rss_feed(rss_entries, rss_template, rss_item_template, site_folder):
template = open(rss_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
# filter - leave names in tact but do not link to relevant documents
# create - list in an index file for website
from shared.censor import privateList
from shared import TagHelper, config, helpers
import shared.censor
from os import listdir, mkdir, path, remove
import shutil
from . import convert
@ -14,7 +14,7 @@ import os
# TODO: generalize based on headings(?) in index.wiki
censor = privateList
censor = shared.censor.privateList
# TODO put this in config too...
filter = ["dream", "gratitude", "review", "jrnl", "work", "job", "debt",
"people", "priv", "threatdefence", "info"]

View file

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

View file

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

View file

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

View file

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