https://github.com/hymkor/go-enex
(unenex) Convert Evernote's export file(*.enex) into HTML and images
https://github.com/hymkor/go-enex
Last synced: 18 days ago
JSON representation
(unenex) Convert Evernote's export file(*.enex) into HTML and images
- Host: GitHub
- URL: https://github.com/hymkor/go-enex
- Owner: hymkor
- License: mit
- Created: 2021-04-06T15:45:02.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2025-03-03T15:10:14.000Z (about 2 months ago)
- Last Synced: 2025-04-10T22:53:00.499Z (18 days ago)
- Language: Go
- Homepage: https://pkg.go.dev/github.com/hymkor/go-enex
- Size: 231 KB
- Stars: 10
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pkg.go.dev/github.com/hymkor/go-enex)
Go-enex & Unenex
====================Convert Evernote's export file(\*.enex) into HTML(or markdown) and images.
- `go-enex` : the package for Go
- `unenex` : the executable using go-enexHow to use Unenex
-----------------### Install
Download the binary package from [Releases](https://github.com/hymkor/go-enex/releases) and extract the executable.
#### Use `go install`
```
go install github.com/hymkor/go-enex/cmd/unenex@latest
```#### Use scoop-installer
```
scoop install https://raw.githubusercontent.com/hymkor/go-enex/master/unenex.json
```or
```
scoop bucket add hymkor https://github.com/hymkor/scoop-bucket
scoop install unenex
```### Usage
```
$ unenex {options} {ENEX-FILENAME.enex}
```Available Options
- `-d directory`: Specifies the output directory (default is the current directory `"."`).
- `-markdown`: Outputs the content in shrinked markdown format.
- `-sf path`: Specifies the path to a stylesheet file.
- `-st stylesheet`: Specifies the stylesheet directly as a string.
- `-v`: Enables verbose mode to display additional information during execution.
- `-web-clip-only`: Outputs only the web-clip content, removing Evernote-specific styling and non-web-clip elements.Library for Go
--------------```example.go
package mainimport (
"fmt"
"io"
"os""github.com/hymkor/go-enex"
)func mains() error {
data, err := io.ReadAll(os.Stdin)
if err != nil {
return err
}
notes, err := enex.Parse(data, os.Stderr)
if err != nil {
return err
}
for _, note := range notes {
html, bundle := note.Extract(nil)
baseName := bundle.BaseName
err := os.WriteFile(baseName+".html", []byte(html), 0644)
if err != nil {
return err
}
fmt.Fprintf(os.Stderr, "Create File: %s.html (%d bytes)\n", baseName, len(html))if len(bundle.Resource) > 0 {
fmt.Fprintf(os.Stderr, "Create Dir: %s", bundle.Dir)
os.Mkdir(bundle.Dir, 0755)
for fname, rsc := range bundle.Resource {
data, err := rsc.Data()
if err != nil {
return err
}
fmt.Fprintf(os.Stderr, "Create File: %s (%d bytes)\n", fname, len(data))
os.WriteFile(fname, data, 0666)
}
}
}
return nil
}
func main() {
if err := mains(); err != nil {
fmt.Fprintln(os.Stderr, err.Error())
os.Exit(1)
}
}
```License
-------MIT License
Acknowledgements
---------------- [@Laetgark](https://github.com/Laetgark)
- [@Juelicher-Trainee](https://github.com/Juelicher-Trainee)
- [@mikaeloduh](https://github.com/mikaeloduh)Release notes
-------------- [Release Notes (English)](release_note_en.md)
- [Release Notes (Japanese)](release_note_ja.md)