Compare commits
No commits in common. "cb3ce3924d3db4d04f439c76983052c7b6b5e728" and "36bda6965ab2e1a206f8c2b7a74f3b022c873662" have entirely different histories.
cb3ce3924d
...
36bda6965a
|
@ -535,7 +535,7 @@ def create_rss_feed(rss_entries, rss_template, rss_item_template, site_folder):
|
||||||
rss_entries.sort(key=lambda x: x["iso_date"], reverse=True)
|
rss_entries.sort(key=lambda x: x["iso_date"], reverse=True)
|
||||||
|
|
||||||
rss_items = ""
|
rss_items = ""
|
||||||
for rss_entry in rss_entries[:50]:
|
for rss_entry in rss_entries:
|
||||||
entry_template = itemTemplate
|
entry_template = itemTemplate
|
||||||
entry_template = entry_template.replace(
|
entry_template = entry_template.replace(
|
||||||
'rssItemTitle', rss_entry["title"])
|
'rssItemTitle', rss_entry["title"])
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
python-with-my-packages = my-python.withPackages (p: with p; [
|
python-with-my-packages = my-python.withPackages (p: with p; [
|
||||||
jinja2
|
jinja2
|
||||||
click
|
click
|
||||||
pytest
|
|
||||||
# other python packages you want in the devShell
|
# other python packages you want in the devShell
|
||||||
]);
|
]);
|
||||||
python-deps = with pkgs.python3Packages; [
|
python-deps = with pkgs.python3Packages; [
|
||||||
|
|
|
@ -1,75 +0,0 @@
|
||||||
import basant.build.kitaab as kitaab
|
|
||||||
from basant.shared import config
|
|
||||||
from jinja2 import Environment, FileSystemLoader
|
|
||||||
import pytest
|
|
||||||
from os import listdir
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
|
||||||
def fake_kitaab(tmp_path_factory):
|
|
||||||
directory = tmp_path_factory.mktemp("public")
|
|
||||||
# Tag file
|
|
||||||
tags_file = directory / ".vimwiki_tags"
|
|
||||||
with open(tags_file, 'w') as fobj:
|
|
||||||
fobj.write("""
|
|
||||||
!_TAG_FILE_FORMAT 2
|
|
||||||
!_TAG_FILE_SORTED 1
|
|
||||||
!_TAG_OUTPUT_MODE vimwiki-tags
|
|
||||||
!_TAG_PROGRAM_AUTHOR Vimwiki
|
|
||||||
!_TAG_PROGRAM_NAME Vimwiki Tags
|
|
||||||
!_TAG_PROGRAM_URL https://github.com/vimwiki/vimwiki
|
|
||||||
!_TAG_PROGRAM_VERSION 2.5
|
|
||||||
jrnl 201017-1546.wiki 2;" vimwiki:201017-1546\t201017-1546
|
|
||||||
dev 201018-1546.wiki 2;" vimwiki:201018-1546\t201018-1546
|
|
||||||
""")
|
|
||||||
# :jrnl: page
|
|
||||||
jrnl_file = directory / "201017-1546.wiki"
|
|
||||||
with open(jrnl_file, 'w') as fobj:
|
|
||||||
fobj.write("""
|
|
||||||
%title 5th June 2018 at 21:56
|
|
||||||
:jrnl:
|
|
||||||
%date 2018-06-05 21:56
|
|
||||||
|
|
||||||
Some jrnl entry
|
|
||||||
""")
|
|
||||||
# :dev: page
|
|
||||||
dev_file = directory / "201018-1546.wiki"
|
|
||||||
with open(jrnl_file, 'w') as fobj:
|
|
||||||
fobj.write("""
|
|
||||||
%title Some dev entry
|
|
||||||
:dev:
|
|
||||||
%date 2018-06-05 21:56
|
|
||||||
|
|
||||||
Some dev entry
|
|
||||||
""")
|
|
||||||
return directory
|
|
||||||
|
|
||||||
class TestGeneration:
|
|
||||||
def test_generate_index_pages(self, fake_kitaab):
|
|
||||||
print(listdir(fake_kitaab))
|
|
||||||
kitaab.generate_index_pages()
|
|
||||||
print(listdir(fake_kitaab))
|
|
||||||
# Build the files by filling out the template
|
|
||||||
file_loader = FileSystemLoader('')
|
|
||||||
env = Environment(loader=file_loader)
|
|
||||||
# regular index pagse use main template
|
|
||||||
template = env.get_template(config.template_main)
|
|
||||||
page_title = 'Dev index'
|
|
||||||
with open(fake_kitaab / 'dev_index.html') as dev_index:
|
|
||||||
html = dev_index.readlines()
|
|
||||||
assert 0
|
|
||||||
|
|
||||||
def test_generate_html_pages(self, fake_kitaab):
|
|
||||||
kitaab.generate_html_pages()
|
|
||||||
assert 0
|
|
||||||
|
|
||||||
def test_generate_head(self, fake_kitaab):
|
|
||||||
kitaab.generate_head()
|
|
||||||
assert 0
|
|
||||||
|
|
||||||
def test_generate_navigation(self, fake_kitaab):
|
|
||||||
kitaab.generate_navigation()
|
|
||||||
assert 0
|
|
||||||
|
|
||||||
def test_generate_sub_pages(self, fake_kitaab):
|
|
||||||
kitaab.generate_sub_pages()
|
|
||||||
assert 0
|
|
Loading…
Reference in a new issue