* Initial work to create new note from template
* Treat template as snippet string
* Small refactor
* Improve semantics of focusNote
* Ask for filename, not title
Authored-by: Jonathan Ingall <jonny@mondago.com>
* Add documentation to the settings getters
* Reduce code noise in the bootstrap method
Files are now all processed in one method,
without `filter`s or `map`s to avoid reallocating arrays.
`addFile` is now inlined, as its function was mostly noise and became
unused.
`isLocalMarkdown` is now done right after listing all workspace files,
before applying the ignore globs.
`registerFiles` merely deals with registering several files,
instead of requiring a loop each time several files are to be
registered.
* Add documentation and type annotations
* Rephrase filterAndRegister docstring
* added test with d3 and g6
* spiked on three graph libraries
* removed unnecessary deps
* small clean up
* picked implementation, cleaned code and added selection
* use title as graph node name instead of note basename
* reloading graph when adding/removing notes
* fixed graph construction to remove node duplicates
* using file name for notes that don't have an h1 title
* added utility functions
* fixed link highlighting bug
* fixed various checks and lint errors
* Start working on date snippets
* Refactor logic to share across date features
* Start providing computed values
This may need to be changed to a Thenable
* Make calculated snippets functional
* Add support for any number
* Comment the code
These comments should be removed later
* Make "+" in snippet work
* Refactor changes
* Remove unused imports
* Add days of week snippets
* Add a shortcut for yesterday's note
* Rename focusDailyNote function
* Move pathExists to utils
* Make navigation on snippet selection configurable
Co-authored-by: Jonathan Ingall <jonny@mondago.com>
* added support for graph middleware via local plugin
* added support for parsing extension points / plugins
* improved parser plugin and added docs
* improved name of parameter
* need to enable local plugins, and improved configuration system
For security reasons local plugins are off by default.
The feature can be enabled via a flag in the foam configuration, which has been expanded to support this case.
The configuration system now reads a `config.json` file inside the `.foam` directory as well as a `~/.foam/config.json` file to configure the system.
Only the user specific configuration file can be used to enable local plugins, as a security measure against malicious repos.
* added prettier configuration file
This ensures consistency across machines as well as an explicit source of truth
* Access correct property on error to display stack trace
* Fix crash when file contains only frontmatter
* Add test for generateHeadings when the file only contains frontmatter
Co-authored-by: Ankit Tiwari <ankitt255@gmail.com>
After #208, id for each note in NoteGraph is hashed. However, in generateReferenceList in file wikilink-reference-generation.ts, the id is still given by the file path, which compromised the core functionality. This PR fixed this bug.
* decoupled ID from note slug
* added vscode debug configuration to work with vscode-jest extension
* made things prettier
* Add a test for parsing empty frontmatter
* Use astPositionToVsCodePosition util function
* fixed a TODOs around URIs and added tests
* added tests around notes querying
* removing unused imports
* Fix typo
* implemented PR feedback
* fixed lint warnings and renamed method for consistency
* removed unnecessary checks and fix compilation error in tests
Co-authored-by: Ankit Tiwari <ankitt255@gmail.com>
* feat: setup jest for foam-vscode
* Add failing test (fails due to missing vscode dependency)
* feat: add vscode mock
Co-authored-by: Jani Eväkallio <jani.evakallio@gmail.com>
* Add frontmatter data to NoteGraph node
* Store document start position inside NoteGraph node
* Add heading below the frontmatter
* Show a progress bar while running Janitor
* Fix tests
* Update note start position to make it 1-indexed
* Initialize frontmatter by an empty object instead of null
* Remove console logs
* revise vscode task and launch configs
- Removed commands from sub-package:
same can be achieved from the root
- Added build and no-build variants.
In case separate watcher is already running,
no need to build.
- Changed watch to build (no hot-reload in vscode by default)
- Show the build in console
Didn't update yarn.lock, seems to want to add
foam-core@0.3.0-alpha.0, but not really
related to this change
Note: the extension tests are failing due to
`Cannot find module '...foam-vscode/out/test/suite/index'`.
However that shouldn't be related to this change either.
* Simplify VS Code launch tasks (shift work to typescript compiler)
* Fix circular dependency index->janitor/index->index
* Use --build flag to use TSC in Build Mode
https://www.typescriptlang.org/docs/handbook/project-references.html#build-mode-for-typescript
This configures tsc to use multiple project roots (vscode, core) and run incremental builds on
changes to each projects. This will necessitate us running the core in commonjs build mode,
which is fine for testing and deployment to node environments, but won't work in the browser,
so foam-core will need a separate build config for UMD builds
* Build foam-core in commonjs mode by default (+cleanup unnecessary config)
* Create ES6 build config for distribution builds
* Cleanup yarn.lock
* Build package before running
* Fix missing lint paths and fix lint error
* Remove redundant .vscode settings files from foam-vscode project
* Add core test launch task
Co-authored-by: jojanaho <janne.ojanaho@iki.fi>