hackstream / zettel Goto Github PK
View Code? Open in Web Editor NEWA notes organizer - based on Zettelkasten methodology.
License: GNU General Public License v3.0
A notes organizer - based on Zettelkasten methodology.
License: GNU General Public License v3.0
Adding Support for Syntax Highlighting would be much useful. I implemented one on my personal fork with chroma and it works perfectly. I also had an idea on customizing the colorschemes from the zettel.toml
file, and found a rather crooked workaround with golang maps.
colorScheme := map[string]*chroma.Style{
"Monokai": styles.Monokai,
"MonokaiLight": styles.MonokaiLight,
}
This has to be finished with all the colorschemes of chroma. The current build works fine. Need some feedback for he above.
I'll send a PR soon
I was trying to host the zettels on my GitHub Pages inside a repo(say 'wiki'), but it seems like the resources doesn't seem to load, it points directly to my base gh pages(.github.io) and not to my gh pages with the repo name(<username.github.io>/wiki). Here is the deployed repo for ref: https://athul.github.io/notes/
Hi and thank you for developing this awesome tool.
Just wanted to check the docs but the site seems down.
Checked with online services too.
We can give an option in config.toml
to remove trailing .html
from the URLs.
Hey,
I was trying to build a wiki of my own and found this in the FossHack Chat Group. I was intrigued and wanted to try it. I write math equations(logical equations) in KaTeX and wanted to have a self-hostable solution for the same.
I found a Bug and Implemented a feature(will send a PR:wink:).
The Bug I found was that zettle doesn't handle images well. I got a full panic when there was an image in the contents
directory.
Here is the panic op
❯./zettel.bin build
DEBU[2020-09-15T16:10:10+05:30] verbose logging enabled
INFO[2020-09-15T16:10:10+05:30] Starting zettel...
2020/09/15 16:10:10 reading config: zettel.toml
panic: runtime error: index out of range [1] with length 1
goroutine 1 [running]:
github.com/hackstream/zettel/internal/pipeline.ReadFiles.func1(0xc0003809a0, 0x18, 0x175f4c0, 0xc000113a00, 0x0, 0x0, 0x10, 0xc0002bf4a8)
/Users/athul/go/src/github.com/athul/zettel/internal/pipeline/pipeline.go:45 +0x58e
path/filepath.walk(0xc0003809a0, 0x18, 0x175f4c0, 0xc000113a00, 0xc0002bf658, 0x0, 0x0)
/usr/local/opt/go/libexec/src/path/filepath/path.go:360 +0x425
path/filepath.walk(0x16539f9, 0x7, 0x175f4c0, 0xc000113380, 0xc0002bf658, 0x0, 0xc000205c70)
/usr/local/opt/go/libexec/src/path/filepath/path.go:384 +0x2ff
path/filepath.Walk(0x16539f9, 0x7, 0xc0002bf658, 0x26, 0x10)
/usr/local/opt/go/libexec/src/path/filepath/path.go:406 +0xff
github.com/hackstream/zettel/internal/pipeline.ReadFiles(0x16539f9, 0x7, 0x0, 0x0, 0x1766720, 0x159d8c0, 0x1583c02)
/Users/athul/go/src/github.com/athul/zettel/internal/pipeline/pipeline.go:24 +0x72
main.(*Hub).build(0xc00008f310, 0xc00021ee00, 0x164f0e4, 0x1)
/Users/athul/go/src/github.com/athul/zettel/cmd/zettel/build.go:78 +0x4b
main.(*Hub).MustHaveConfig.func1(0xc00021ee00, 0x1, 0x1)
/Users/athul/go/src/github.com/athul/zettel/cmd/zettel/middleware.go:19 +0xe6
github.com/urfave/cli/v2.(*Command).Run(0xc0001dbe60, 0xc00021ed40, 0x0, 0x0)
/Users/athul/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:164 +0x4e0
github.com/urfave/cli/v2.(*App).RunContext(0xc000082480, 0x175cbe0, 0xc000166ce0, 0xc0000aa000, 0x2, 0x2, 0x0, 0x0)
/Users/athul/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:306 +0x814
github.com/urfave/cli/v2.(*App).Run(...)
/Users/athul/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:215
main.main()
/Users/athul/go/src/github.com/athul/zettel/cmd/zettel/main.go:87 +0x4cc
I implemented the math support with a goldmark extension. Specifically a personal fork of the extension due to a compilation error in the original extension.
Here is an image without the math support
Here is an image with Math Support from KaTex
This Math support is made possible by KaTeX Js and CSS in the Head tag of header.tmpl
Currently we aren't documenting all the metadata which are valid in yaml
frontmatter.
cc: @mr-karan
I guess the updates made in #19 made the syntaxHighlighter to work wrong. Especially this line
Line 86 in 92a3bdf
It passes the SitePrefix which is not the needed Argument. I had made a patch on my fork and will send a PR with the changes. Also removed the code for syntaxHighlighting made in #17 and replaced that with this library which was written by the author of Goldmark itself.
Go 1.16 introduced a file embedding feature. We should ideally use this instead of stuffbin. Also using this, we can enable giving an option for custom templating path while building.
We should add support for drafts as well since we might write something which isn't complete yet and can't publish them.
CC: @mr-karan
zettel build on a shiny new project produces the following error:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0xb0e55f]
goroutine 1 [running]:
main.(*Hub).makeDist(0xc00054db90, 0x0, 0x0)
/home/operator/go/src/github.com/hackstream/zettel/cmd/zettel/build.go:51 +0x7bf
main.(*Hub).build(0xc00054db90, 0xc00064d040, 0xbfeffd, 0x1)
/home/operator/go/src/github.com/hackstream/zettel/cmd/zettel/build.go:95 +0x185
main.(*Hub).MustHaveConfig.func1(0xc00064d040, 0x1, 0x1)
/home/operator/go/src/github.com/hackstream/zettel/cmd/zettel/middleware.go:21 +0x15b
github.com/urfave/cli/v2.(*Command).Run(0xc0002e5200, 0xc00064cf80, 0x0, 0x0)
/home/operator/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:164 +0x4ed
github.com/urfave/cli/v2.(*App).RunContext(0xc000602300, 0xd88640, 0xc0001e8cf0, 0xc00012c000, 0x2, 0x2, 0x0, 0x0)
/home/operator/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:306 +0x81f
github.com/urfave/cli/v2.(*App).Run(...)
/home/operator/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:215
main.main()
/home/operator/go/src/github.com/hackstream/zettel/cmd/zettel/main.go:95 +0x52f
config:
description = "Hello World. This is my zettel notebook"
pygmentsstyle = "monokailight"
site_name = "My Zettel"
test$ zettel --verbose build
DEBU[2020-09-21T11:43:14+03:00] verbose logging enabled
INFO[2020-09-21T11:43:14+03:00] Starting zettel...
2020/09/21 11:43:14 reading config: zettel.toml
2020/09/21 11:43:14 error while yaml unmarshal: yaml: line 3: mapping values are not allowed in this context
ERRO[2020-09-21T11:43:14+03:00] OOPS: yaml: line 3: mapping values are not allowed in this context
I'd like to know what exactly yaml file cause this error but zettel doesn't show this information.
As received feedback from Kailash, we should have a way for users to browse through zettel:
Currently the only way to see all posts is /all.html
but then you lose the navigation when you go inside any "linked" note.
Some more enhancements I can think of:
Currently zettel
only build a static site but while writing notes it would be a much better experience if we reload when a change is made by the user.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.