Giter VIP home page Giter VIP logo

anex's Introduction

anex

A script to export Apple notes to HTML and PDF

disclaimer

This is in no way affiliated to Apple. By using this project, you also agree to Apple's licensing that applies to Apple Notes. Neither they nor myself grant any form of warranty or other forms of compensation in cases of data loss or other software or hardware related damage. Use at your own caution!

Also, this is a command line utility. Basic knowledge of the mentioned terms is advised.

prerequisites

You need a Mac, a (healthy) notes store and installed Xcode Command Line Utilites, which should include sqlite3 and zlib.

build

cd into the directory you downloaded the source and call clang -framework Foundation -framework ScriptingBridge -framework UniformTypeIdentifiers -framework CoreServices -framework CoreGraphics -framework CoreText -framework AppKit -framework Foundation -lz -lsqlite3 -arch x86_64 -arch arm64 -fobjc-arc anex/main.m -o anex.exec (anex.exec because clang otherwise complains about the name conflicting with directory).

use

After you either downloaded a release of anex or built it yourself, you may execute it by cding into the location of the binary and calling ./anex. A list of options will be displayed:

Usage: anex <output-dir> [--create-indices | --embed-media | --copy-media | --as-pdf | --embed-media | --custom-stylesheet <file>]
<output-dir>        an output directory to write to; will be created if not existing
--create-indices    create index files in the output, account and folder directories
--embed-media       embed files in the HTML documents, making them portable; do not use with --copy-media
--as-pdf            export all notes as PDF; --create-indices will be ignored for now
--as-md				export all notes as markdown; --create-indices will be ignored for now
--copy-media        copy files to the output directory; do not use with --embed-media
--custom-stylesheet use the custom stylesheet <file>; will be either copied (default) or embedded
--embed-stylesheet  embed the stylesheet in each HTML file

Please keep in mind that nothing is portable as long as you dont embed anything. Indices use relative paths, media absolute ones. If you want to archive your notes and delete the stuff in iCloud, you need to use --embed-media or simply export as PDF with --as-pdf altogether as files the HTMLs are pointing to will not be there anymore!

By default, a default set of styles is used and all notes are exported as HTML without any indices and no media embedded.

exporting

HTML is thought to be a base for further conversions, although direct PDF export is supported as well.

TODO

  • nicer default CSS (especially media stuff)
  • fancy javascript stuff, including a darkmode switch for HTML?
  • what the hell is my code, not to mention my CSS
  • why does CoreGraphics crash with certain PDF pages

additional notes

  • The Notes.h in the anex folder has been created using the sdef and sdp utilities.
  • The colors have been identified using the "Digital Color Meter" app provided in macOS. Feel free to change anything in there.
  • If CoreGraphics PDF has logged an error. Set environment variable "CG_PDF_VERBOSE" to learn more., don't worry. Your PDF pages might fall back on some fonts or something.

credits

  • Apple for creating a really nice app to take notes - its nice to see how it has evolved and can now basically do anything I want (except clean exports of notes ._.)
  • w3schools.com - Really, I have pretty much no idea of CSS and would have quite a problem without these guys. Most of the UI elements in the HTML are from them, thanks for your work :).

anex's People

Contributors

thebreadcompany avatar

Watchers

 avatar

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.