vault backup: 2025-12-06 00:29:07
All checks were successful
Deploy Quartz site to GitHub Pages / build (push) Successful in 1m17s
All checks were successful
Deploy Quartz site to GitHub Pages / build (push) Successful in 1m17s
This commit is contained in:
@@ -295,23 +295,4 @@ Jongradienter Na/Kalium mkt inne/ut på av ATPaset-pump
|
||||
ABC kräver 2 ATP fosfo+defosfo
|
||||
MDR inblandat i pumpar
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
![[Pasted image 20251125132516.png]]
|
||||
25
static.py
25
static.py
@@ -1,25 +0,0 @@
|
||||
from obsidian_parser import Vault
|
||||
import markdown
|
||||
|
||||
v = Vault("content")
|
||||
note = v.get_note("Biokemi/Cellulära processer/Transport över cellmembran/Anteckningar.md")
|
||||
body = markdown.markdown(note.reading_view)
|
||||
html = f"""<!html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
p {{
|
||||
white-space: pre-wrap;
|
||||
}}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
{body}
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
with open("test.html", "w") as f:
|
||||
f.write(html)
|
||||
|
||||
import webbrowser
|
||||
webbrowser.open("test.html")
|
||||
46
wip/static.py
Normal file
46
wip/static.py
Normal file
@@ -0,0 +1,46 @@
|
||||
import pathlib
|
||||
from obsidian_parser import Vault
|
||||
import markdown
|
||||
import jinja2
|
||||
|
||||
root_dir = pathlib.Path(__file__).parent
|
||||
vault = Vault(root_dir / ".." / "content")
|
||||
note = vault.get_note("Biokemi/Cellulära processer/Transport över cellmembran/Anteckningar.md")
|
||||
loader = jinja2.FileSystemLoader(root_dir / "templates")
|
||||
env = jinja2.Environment(loader=loader)
|
||||
|
||||
from markdown.preprocessors import Preprocessor
|
||||
import re
|
||||
|
||||
class NoRender(Preprocessor):
|
||||
""" Skip any line with words 'NO RENDER' in it. """
|
||||
def run(self, lines):
|
||||
new_lines = []
|
||||
for line in lines:
|
||||
print(repr(line))
|
||||
m = re.search(r"!\[\[(.*)\]\]", line)
|
||||
if m:
|
||||
print(m.groups())
|
||||
return new_lines
|
||||
|
||||
from markdown.extensions import Extension
|
||||
|
||||
class MyExtension(Extension):
|
||||
def extendMarkdown(self, md):
|
||||
md.preprocessors.register(NoRender(md), 'mypattern', 175)
|
||||
|
||||
m = markdown.Markdown(extensions=[])
|
||||
print(m.registeredExtensions)
|
||||
env.filters["markdown"] = m.convert
|
||||
|
||||
output = root_dir / "test.html"
|
||||
template = env.get_template("base.html")
|
||||
|
||||
with output.open("w", encoding="utf-8") as f:
|
||||
print(note.reading_view)
|
||||
output = template.render(note=note, vault=vault)
|
||||
f.write(output)
|
||||
|
||||
#import webbrowser
|
||||
#webbrowser.open(output.as_uri())
|
||||
#print(f"Written to {output}")
|
||||
15
wip/templates/base.html
Normal file
15
wip/templates/base.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
p {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
</style>
|
||||
<title>{{note.title}}</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>{{note.title}}</h1>
|
||||
{{note.reading_view | markdown}}
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,4 +1,4 @@
|
||||
<!html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
@@ -6,8 +6,10 @@
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
</style>
|
||||
<title>Anteckningar</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Anteckningar</h1>
|
||||
<p>Diffusion är något INTE behöver hjälp
|
||||
Passiv vs Aktiv transport
|
||||
Faciliterad diffusion</p>
|
||||
@@ -272,5 +274,6 @@ kanalfogar binder ihop små celler, t.ex. näring i benceller
|
||||
Jongradienter Na/Kalium mkt inne/ut på av ATPaset-pump
|
||||
ABC kräver 2 ATP fosfo+defosfo
|
||||
MDR inblandat i pumpar</p>
|
||||
<p>!Pasted image 20251125132516.png</p>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user