GithubHelp home page GithubHelp logo

hackstream / zettel Goto Github PK

View Code? Open in Web Editor NEW
154.0 154.0 10.0 802 KB

A notes organizer - based on Zettelkasten methodology.

License: GNU General Public License v3.0

Makefile 1.78% Go 94.03% CSS 4.19%
note-taking zettelkasten-methodology

zettel's People

Contributors

athul avatar iamd3vil avatar mr-karan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zettel's Issues

Syntax Highlighting

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

The documents website seems dead

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.

Support Math Equations and Images

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

Screen Shot 2020-09-15 at 4 13 50 PM

Here is an image with Math Support from KaTex
Screen Shot 2020-09-15 at 4 18 33 PM

This Math support is made possible by KaTeX Js and CSS in the Head tag of header.tmpl

Syntax Highlighting Issue

I guess the updates made in #19 made the syntaxHighlighter to work wrong. Especially this line

if err = pipeline.ConvertMarkdownToHTML(posts, hub.Config.SitePrefix); err != nil {

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.

Replace stuffbin with Go 1.16's embed feature

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.

panic while building

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"

zettel build fail with error but doesn't show what yaml is invalid

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.

Sidebar - Easier Navigation

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:

  • Expanded tooltip with a "preview" of linked note. This would require some JS.

Add live reloading in dev mode

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.