* Update eslint config
* Applied linter to lib
* Applied eslint config to CliClient/app
* Removed prettier due to https://github.com/prettier/prettier/pull/4765
* First pass on test units
* Applied linter config to test units
* Applied eslint config to clipper
* Applied to plugin dir
* Applied to root of ElectronClient
* Applied on RN root
* Applied on CLI root
* Applied on Clipper root
* Applied config to tools
* test hook
* test hook
* test hook
* Added pre-commit hook
* Applied rule no-trailing-spaces
* Make sure root packages are installed when installing sub-dir
* Added doc
* Dekstop,CLI: enex_to_md: add html/md test file pairs
* one pair for basic text formatting tags: strong, b, i, em
* and one using span tags with inline styles for bold formatting
Note: The html files include the Evernote-typical "linebreak tags inside of separate <div> tags"
to represent empty lines!
* Desktop,Cli: enex_to_md: support bold in span tags using inline styles
* function isSpanWithStyle() checks if further processing of a span tag
makes sense
* function isSpanStyleBold() checks if bold formatting via styles is
used - a similar function could be written for each span-inline-style-format
that should be supported
* Desktop,Cli: enex_to_md: fix saving span attrs in state object
pushing attributes of span tag to state object now
happens outside of isSpanWithStyle()
* enable drag and drop fileURLs
* fix windows fileURL syntax
* introduce encodeURI function
* fixed encoding issue
* use path-utils.js to deal with fileURL path conversion
* add changes as requested
* Minor rewording 'On the' -> 'In the', additional info about attaching files
* change call of toFileProtocolPath
* enable test script to check syntax for all OS-platforms
* Korean Language Support
Korean Language 100% Translated, but something is roughted. soon fix it ;)
* some improved
Some Improved
* Improve v2
some polished
* Ok, now Completed
For Now, Completed Polish(Change Respect of Users, and several fixing & polishing) + 100% Translated. Ready to Shipping
* Changed cancel and delete translation (ITALIAN)
Changed cancel from "cancellare" to "annullare" (whic is used more to express the cancelling operations) and delete from "cancellare" to "eliminare". I think that doing this will help people understanding what is the main task of these option since they use the same verbs in the current translation.
* Update it_IT.po
* First pass of adding support for templates
* remove default value from template prompt
* Add template placeholder text
* Add mustache templates with datetime support for new notes
* Moved template code to utils, added separate prompt for templates
* Add templates to menu and allow for keyboad only use
* update template prompt for dark theme
* update with laurents suggestions, add refresh button
* revert template command, remove new note prompt
* show git branch and hash in About dialog
This additional info will only be shown, if the code is not an official release.
An official release is calculated as follows:
- current commit has a tag
- the tag contains the version number of the package
However, the information will always be printed to the console.
* info will now always be shown in About dialog (if available)
ElectronClient/app/compile-package-info.js: added warning
ElectronClient/app/app.js: push info conditionally to the message array
* use sprintf syntax
* Fixes#1186, #1354. Clears search when clicking on a notebook.
* use new resetSearch method where possible, replaced tabs with spaces
* replaced a couple more spaces with tabs
* updated Contributing.md
- Added several guidelines
- Moved some rules to bulleted lists (for quicker reading).
* Replace links to old forum domain to new domain. Removed a word.
* Allow downloading resources automatically, on demand, or when loading note
* Make needToBeFetched calls to return the right number of resources
* All: Improved handling of resource downloading and decryption
* Desktop: Click on resource to download it (and, optionally, to decrypt it)
* Desktop: Better handling of resource state (not downloaded, downloading, encrypted) in front end
* Renamed setting to sync.resourceDownloadMode
* Download resources when changing setting
* tweaks
* removed duplicate cs
* Better report resource download progress
* Make sure resource cache is properly cleared when needed
* Also handle manual download for non-image resources
* More improvements to logic when downloading and decrypting resources
* Started revisions support
* More rev changes
* More rev changes
* More revs changes
* Fixed deletion algorithm
* More tests and moved updated time to separate field
* Display info when restoring note
* Better handling of existing notes
* wip
* Further improvements and fixed tests
* Better handling of changes created via sync
* Enable chokidar again
* Testing special case
* Further improved logic to handle notes that existed before the revision service
* Added tests
* Better handling of encrypted revisions
* Improved handling of deleted note revisions by moving logic to collectRevision
* Improved handling of old notes by moving logic to collectRevision()
* Handle case when deleting revisions while one is still encrypted
* UI tweaks
* Added revision service to mobile app
* Fixed config screens on mobile and desktop
* Enabled revisions on CLI app
Tests to confirm serialize/unserialize don't change body and title
check if item title exists, otherwise display default title.
added test checking serializing/unserializing Folders don't modify data
* Add Close Window to macOS file menu
* Add Joplin to Quit menu item
On macOS the application name appears usually within the Quit menu item.
* Use performClose: selector for Close Window
* Revert Quit with name and add Quit string to translations
* Move Quit translation to joplin.pot
* Remove Quit string
Added animation to icon in synchronize button
Moved sync report above button, which prevents the sync button from moving from its place when the report has text.
Added animation to icon in Toggle Sidebar button, using the css transition property.
Reduced font size for text and icons in header and sidebar
Changed theme color2 from white to a very light grey. It is barely
noticeable, but reduces contrast a bit, improving readability.
* add option to use soft breaks for markdown rendering
* oops, I didn't use the British spelling
* moved setting to section Plugins
* change text -> Enable soft breaks
* Initial test of enabling plugins
* Added support for toggle-able plugins
- Also adds some new plugins
* Add instructions on adding toggle-plugins
* Fix subtle anchor bug
- webview was moving itself when scrolling to bottom anchors
* Moves the webview hack so that it only applies to anchors
* Add plugin descriptions to the README, also removed mermaid from README
* rename plugin.* to markdown.plugin.* to be more forward compatible
* macOS: make the menu more like a macOS menu
* remove duplcated code even more
* yep, I forgot to localize the new menu item
* more de-duplication, create File menu on macOS
* update the version info string for mobiles to be consistent with the desktop
Joplin vX.Y.Z -> Joplin X.Y.Z
hardcoded the string. Joplin is a product name, no need for translation.
* show version as X.Y.Z in update dialog
* update .po files so that the previous commit won't break translations
* tag -> Schlagwort
* Refactoring MdToHtml to avoid manually rendering tokens
* Minor fix
* Fixed loading of resources
* Handle clicking on checkboxes
* Added back Katex support
* Fixed issues with Katex and note rendering
* Added back support for links
* Restored code block highlighting support
* clean up
* Applying update to mobile
* Fixed handling of links and cleaned up to share more code between mobile and desktop
* Restored content caching and improved handling of additional assets
* Clean up and a few fixes
* Applied more updates to mobile and added code highlighting support
* Add type 'info' and 'OK' button to update dialogue when current version is up to date
* remove whitespace and fix space to tabs
* remove created newline at end of file
This reverts commit 6e235605ed.
Fixed#1144: e2ee decrypt cannot be used inside cron. If we need
manually decrypting a file, we'll need to move this command
somewhere else.
* Adds functionality to toggle the notebooks and tags on the sidebar.
Signed-off-by: Abijeet <abijeetpatro@gmail.com>
* Modified to not use an anonymous function.
Signed-off-by: abijeetpatro <abijeetpatro@gmail.com>
* Updated the code to be cleaner.
Signed-off-by: abijeet <abijeetpatro@gmail.com>
* update norwegian translation and correct locale name to nb_NO
* set no to nb_NO in documentation
* Add name, email and completion to README
Norwegian translation
* Don't create unused VERSION file
It will throw an error if the script is run from a non-writable directory
* Warn user if running as root
This will write files as root:root
* Clearer root warning
* fix for #906, 1) windows paths like C:\a\b weren't accepted because backslashes were treated as escape sequences, 2) common paths like C:\Program Files\Foo\Foo.exe weren't accepted because of the space in the path
* Using anothing approach,
a) backslashes are no longer treated as escape characters,
b) string change to remind people to add spaces
* Removing joplin.pot from the patch, it will be updated later.
* Removing unused code.
* Adds functionality to display tags under the open note.
Towards #469
Signed-off-by: Abijeet <abijeetpatro@gmail.com>
* Ensured tags in the dialog box and under the note appear in the same order.
Few formatting tweaks.
Signed-off-by: Abijeet <abijeetpatro@gmail.com>
* Fixes issues raised during code review.
Signed-off-by: Abijeet <abijeetpatro@gmail.com>
* Refactored code to always display tags in ascending order.
This changes the order of the tags in the dialog box and below the tag title.
Signed-off-by: Abijeet <abijeetpatro@gmail.com>
* Added the new tag height and margin bottom to the bottomRowHeight
Fixes#979
Signed-off-by: Abijeet <abijeetpatro@gmail.com>
* Show note title in pdf export (#890)
An example of a possible approach, to temporarily change the html in the webview to show the note title. Works, but there may be a more elegant fix.
* Show title in pdf export
Revising based on feedback
Also, a couple changes to tests so that they pass in Windows.
* Added support for the dark mode on desktop
* Add dark highlighting to the code tags
* Update app/theme.js to be more clear and more easily support additional themes
Update more files to conform to theming
* Adds functionality to display tags under the open note.
Towards #469
Signed-off-by: Abijeet <abijeetpatro@gmail.com>
* Ensured tags in the dialog box and under the note appear in the same order.
Few formatting tweaks.
Signed-off-by: Abijeet <abijeetpatro@gmail.com>
* Fixes issues raised during code review.
Signed-off-by: Abijeet <abijeetpatro@gmail.com>
* Refactored code to always display tags in ascending order.
This changes the order of the tags in the dialog box and below the tag title.
Signed-off-by: Abijeet <abijeetpatro@gmail.com>
* Fixed some typos and inconsistencies in the german language file and added missing translations.
* Fixed some more inconsistencies in german language file.
The script was original written for “Ubuntu – Gnome” only. I change it a little bit to support more distributions and desktop enviroments.
This script could be used to install and update Joplin at several Linux distributions. I could test this script with “Fedora 28 – Cinnamon” and “Mint LMDE 3”. There are a lot of requests how to install / start Joplin at Linux in the FAQ’s. Hopefully this could help the people
If no former version is present, the script fails since the rm commands do not succeed.
Added -f to rm in order to ignore non-existent directories to be deleted.
Hi,
i'm new to github... i hope this help and i've not done some mistake
i think that:
"notebook" should be named "taccuini" in italian like evenote does
"to-do" can be translated in "Cose-da-fare" not in "attività" that means "activity/activities"
now... i've also a feature request to improve the user interaction with the sidebar and to focus more on the "to-do" stuff
where i can send/post my little suggestion?
thank you
This changes the behaviour so that loading a note does automatically
focus the note text/title only when a new note is being created.
This reduces accidental edits and is in line with other note taking
applications such as Simplenote, Evernote and Apple Notes.
2018-07-10 08:35:21 +02:00
602 changed files with 99488 additions and 34234 deletions
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an issue becomes stale
daysUntilStale:90
# Number of days of inactivity before a stale issue is closed
daysUntilClose:7
# Issues with these labels will never be considered stale
exemptLabels:
- "good first issue"
- "essential"
- "essential-reviewed"
- "help wanted"
- "nice to have"
- "upstream"
- "backlog"
# Label to use when marking an issue as stale
staleLabel:stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment:>
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs.
You may also label this issue as "backlog" and I will leave it open.
Thank you for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment:>
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.
- All the applications share the same library, which, for historical reasons, is in ReactNativeClient/lib. This library is copied to the relevant directories when building each app.
- The translations are built by running CliClient/build-translation.sh. You normally don't need to run this if you haven't updated the translation since the compiled files are on the repository.
If there's an error `while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory`, run `sudo apt-get install libgconf-2-4`
If you get a node-gyp related error you might need to manually install it: `npm install -g node-gyp`.
If you get the error `libtool: unrecognized option '-static'`, follow the instructions [in this post](https://stackoverflow.com/a/38552393/561309) to use the correct libtool version.
That will create the executable file in the `dist` directory.
From `/ElectronClient` you can also run `run.sh` to run the app for testing.
@@ -56,6 +59,10 @@ If node-gyp does not works (MSBUILD: error MSB3428: Could not load the Visual C+
If `yarn dist` fails, it may need administrative rights.
If you get an `error MSB8020: The build tools for v140 cannot be found.` try to run with a different toolset version, eg `npm install --toolset=v141` (See [here](https://github.com/mapbox/node-sqlite3/issues/1124) for more info).
The [building\_win32\_tips on this page](./readme/building_win32_tips.md) might be helpful.
# Building the Mobile application
First you need to setup React Native to build projects with native code. For this, follow the instructions on the [Get Started](https://facebook.github.io/react-native/docs/getting-started.html) tutorial, in the "Building Projects with Native Code" tab.
For general discussion about Joplin, user support, software development questions, and to discuss new features, please go to the [Joplin Forum](https://discourse.joplin.cozic.net/). It is possible to login with your GitHub account.
The [Joplin Forum](https://discourse.joplinapp.org/) is the community driven place for user support, general discussion about Joplin, problems with installation, new features and software development questions. It is possible to login with your GitHub account. Don't use the issue tracker for support questions.
# Reporting a bug
Please check first that it [has not already been reported](https://github.com/laurent22/joplin/issues?utf8=%E2%9C%93&q=is%3Aissue). Also consider [enabling debug mode](https://github.com/laurent22/joplin/blob/master/readme/debugging.md) before reporting the issue so that you can provide as much details as possible to help fix it.
File bugs in the [Github Issue Tracker](https://github.com/laurent22/joplin/issues?utf8=%E2%9C%93&q=is%3Aissue). Please follow these guidelines:
If possible, **please provide a screenshot**. A screenshot showing the problem is often more useful than a paragraph describing it as it can make it immediately clear what the issue is.
- Search existing issues first, make sure yours hasn't already been reported.
- Consider [enabling debug mode](https://joplinapp.org/debugging/) so that you can provide as much details as possible when reporting the issue.
- Stay on topic, but describe the issue in detail so that others can reproduce it.
- **Provide a screenshot** if possible. A screenshot showing the problem is often more useful than a paragraph describing it.
- For web clipper bugs, **please provide the URL causing the issue**. Sometimes the clipper works in one page but not in another so it is important to know what URL has a problem.
# Feature requests
Again, please check that it has not already been requested. If it has, simply**up-vote the issue**- the ones with the most up-votes are likely to be implemented. "+1" comments are not tracked.
Please check that your request has not already been posted in the [Github Issue Tracker](https://github.com/laurent22/joplin/issues?utf8=%E2%9C%93&q=is%3Aissue). If it has, **up-voting the issue**increases the chances it'll be noticed and implemented in the future. "+1" comments are not tracked.
# Adding new features
As a general rule, suggestions to *improve Joplin* should be posted first in the [Joplin Forum](https://discourse.joplinapp.org/) for discussion.
If you want to add a new feature, consider asking about it before implementing it or checking existing discussions to make sure it is within the scope of the project. Of course you are free to create the pull request directly but it is not guaranteed it is going to be accepted.
Avoid listing multiple requests in one report in the [Github Issue Tracker](https://github.com/laurent22/joplin/issues?utf8=%E2%9C%93&q=is%3Aissue). One issue per request makes it easier to track and discuss it.
Finally, when submitting a pull request, don't forget to [test your code](#unit-tests).
# Contribute to the project
## Contributing to Joplin's translation
Joplin is available in multiple languages thanks to the help of its users. You can help translate Joplin to your language or keep it up to date. Please read the documentation about [Localisation](https://joplinapp.org/#localisation).
## Contributing to Joplin's code
If you want to start contributing to the project's code, please follow these guidelines before creating a pull request:
- Bug fixes are always welcome. Start by reviewing the list of [essential issues](https://github.com/laurent22/joplin/issues?q=is%3Aissue+is%3Aopen+label%3Aessential)
- Before adding a new feature, ask about it in the [Github Issue Tracker](https://github.com/laurent22/joplin/issues?utf8=%E2%9C%93&q=is%3Aissue) or the [Joplin Forum](https://discourse.joplinapp.org/), or check if existing discussions exist to make sure the new functionality is desired.
- **Changes that will consist in more than 50 lines of code should be discussed the [Joplin Forum](https://discourse.joplinapp.org/)**, so that you don't spend too much time implementing something that might not be accepted.
Building the apps is relatively easy - please [see the build instructions](https://github.com/laurent22/joplin/blob/master/BUILD.md) for more details.
## Coding style
Coding style is enforced by a pre-commit hook that runs eslint. This hook is installed whenever running `npm install` on any of the application directory. If for some reason the pre-commit hook didn't get installed, you can manually install it by running `npm install` at the root of the repository.
## Unit tests
When submitting a pull request for a new feature or bug fix, please add unit tests for your code. Unit testing GUI changes is not always possible so it is not required, but any change in a file under /lib for example should be unit tested.
The tests are under CliClient/tests. To get them running, you first need to build the CLI app:
cd CliClient
npm i
To run the test units, you must have an instance of the cli app running. In a first window navigate into `CliClient` and run:
```sh
./run.sh
```
> If you get an error like `Error: Cannot find module '../locales/index.js'`, this means you must (a) rebuild translations or (b) take > them from one of the other apps. To do option b, you can run the following command to copy them from the `ReactNativeClient` directory:>
@@ -299,7 +299,7 @@ class Application extends BaseApplication {
letoutException=null;
try{
if(this.gui().isDummy()&&!this.activeCommand_.supportsUi('cli'))thrownewError(_('The command "%s" is only available in GUI mode',this.activeCommand_.name()));
if(this.gui().isDummy()&&!this.activeCommand_.supportsUi('cli'))thrownewError(_('The command "%s" is only available in GUI mode',this.activeCommand_.name()));
description.push('Joplin is a note taking and to-do application, which can handle a large number of notes organised into notebooks.');
description.push('The notes are searchable, can be copied, tagged and modified with your own text editor.');
description.push("\n\n");
description.push('\n\n');
description.push('The notes can be synchronised with various target including the file system (for example with a network directory) or with Microsoft OneDrive.');
description.push("\n\n");
description.push('\n\n');
description.push('Notes exported from Evenotes via .enex files can be imported into Joplin, including the formatted content, resources (images, attachments, etc.) and complete metadata (geolocation, updated time, created time, etc.).');
@@ -72,14 +72,7 @@ function assertEquals(expected, real) {
}
asyncfunctionclearDatabase(){
awaitdb.transactionExecBatch([
'DELETE FROM folders',
'DELETE FROM notes',
'DELETE FROM tags',
'DELETE FROM note_tags',
'DELETE FROM resources',
'DELETE FROM deleted_items',
]);
awaitdb.transactionExecBatch(['DELETE FROM folders','DELETE FROM notes','DELETE FROM tags','DELETE FROM note_tags','DELETE FROM resources','DELETE FROM deleted_items']);
lines.push('When the Web Clipper service is enabled, Joplin exposes a [REST API](https://en.wikipedia.org/wiki/Representational_state_transfer) which allows third-party applications to access Joplin\'s data and to create, modify or delete notes, notebooks, resources or tags.');
lines.push('');
lines.push('In order to use it, you\'ll first need to find on which port the service is running. To do so, open the Web Clipper Options in Joplin and if the service is running it should tell you on which port. Normally it runs on port **41184**. If you want to find it programmatically, you may follow this kind of algorithm:');
lines.push(' const result = pingPort(portToTest); // Call GET /ping');
lines.push(' if (result == \'JoplinClipperServer\') {');
lines.push(' port = portToTest; // Found the port');
lines.push(' break;');
lines.push(' }');
lines.push('}');
lines.push('```');
lines.push('');
lines.push('# Authorisation');
lines.push('');
lines.push('To prevent unauthorised applications from accessing the API, the calls must be authentified. To do so, you must provide a token as a query parameter for each API call. You can get this token from the Joplin desktop application, on the Web Clipper Options screen.');
lines.push('');
lines.push('This would be an example of valid cURL call using a token:');
lines.push('In the documentation below, the token will not be specified every time however you will need to include it.');
lines.push('');
lines.push('# Using the API');
lines.push('');
lines.push('All the calls, unless noted otherwise, receives and send **JSON data**. For example to create a new note:');
lines.push('');
lines.push('\tcurl --data \'{ "title": "My note", "body": "Some note in **Markdown**"}\' http://localhost:41184/notes');
lines.push('');
lines.push('In the documentation below, the calls may include special parameters such as :id or :note_id. You would replace this with the item ID or note ID.');
lines.push('');
lines.push('For example, for the endpoint `DELETE /tags/:id/notes/:note_id`, to remove the tag with ID "ABCD1234" from the note with ID "EFGH789", you would run for example:');
lines.push('The four verbs supported by the API are the following ones:');
lines.push('');
lines.push('* **GET**: To retrieve items (notes, notebooks, etc.).');
lines.push('* **POST**: To create new items. In general most item properties are optional. If you omit any, a default value will be used.');
lines.push('* **PUT**: To update an item. Note in a REST API, traditionally PUT is used to completely replace an item, however in this API it will only replace the properties that are provided. For example if you PUT {"title": "my new title"}, only the "title" property will be changed. The other properties will be left untouched (they won\'t be cleared nor changed).');
lines.push('* **DELETE**: To delete items.');
lines.push('');
lines.push('# Filtering data');
lines.push('');
lines.push('You can change the fields that will be returned by the API using the `fields=` query parameter, which takes a list of comma separated fields. For example, to get the longitude and latitude of a note, use this:');
lines.push('In case of an error, an HTTP status code >= 400 will be returned along with a JSON object that provides more info about the error. The JSON object is in the format `{ "error": "description of error" }`.');
lines.push('');
lines.push('# About the property types');
lines.push('');
lines.push('* Text is UTF-8.');
lines.push('* All date/time are Unix timestamps in milliseconds.');
lines.push('* Booleans are integer values 0 or 1.');
lines.push('');
lines.push('# Testing if the service is available');
lines.push('');
lines.push('Call **GET /ping** to check if the service is available. It should return "JoplinClipperServer" if it works.');
lines.push('');
lines.push('# Searching');
lines.push('');
lines.push('Call **GET /search?query=YOUR_QUERY** to search for notes. This end-point supports the `field` parameter which is recommended to use so that you only get the data that you need. The query syntax is as described in the main documentation: https://joplinapp.org/#searching');
description:'If `body_html` is provided and contains relative URLs, provide the `base_url` parameter too so that all the URLs can be converted to absolute ones. The base URL is basically where the HTML was fetched from, minus the query (everything after the \'?\'). For example if the original page was `https://stackoverflow.com/search?q=%5Bjava%5D+test`, the base URL is `https://stackoverflow.com/search`.',
});
tableFields.push({
name:'image_data_url',
type:Database.enumId('fieldType','text'),
description:'An image to attach to the note, in [Data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format.',
});
tableFields.push({
name:'crop_rect',
type:Database.enumId('fieldType','text'),
description:'If an image is provided, you can also specify an optional rectangle that will be used to crop the image. In format `{ x: x, y: y, width: width, height: height }`',
});
// tableFields.push({
// name: 'tags',
// type: Database.enumId('fieldType', 'text'),
// description: 'Comma-separated list of tags. eg. `tag1,tag2`.',
// });
}
lines.push('# '+toTitleCase(tableName));
lines.push('');
if(model.type===BaseModel.TYPE_FOLDER){
lines.push('This is actually a notebook. Internally notebooks are called "folders".');
lines.push('The folders are returned as a tree. The sub-notebooks of a notebook, if any, are under the `children` key.');
lines.push('');
}
lines.push('## GET /'+tableName+'/:id');
lines.push('');
lines.push('Gets '+singular+' with ID :id');
lines.push('');
if(model.type===BaseModel.TYPE_TAG){
lines.push('## GET /tags/:id/notes');
lines.push('');
lines.push('Gets all the notes with this tag.');
lines.push('');
}
if(model.type===BaseModel.TYPE_NOTE){
lines.push('## GET /notes/:id/tags');
lines.push('');
lines.push('Gets all the tags attached to this note.');
lines.push('');
}
if(model.type===BaseModel.TYPE_FOLDER){
lines.push('## GET /folders/:id/notes');
lines.push('');
lines.push('Gets all the notes inside this folder.');
lines.push('');
}
if(model.type===BaseModel.TYPE_RESOURCE){
lines.push('## GET /resources/:id/file');
lines.push('');
lines.push('Gets the actual file associated with this resource.');
lines.push('');
}
lines.push('## POST /'+tableName);
lines.push('');
lines.push('Creates a new '+singular);
lines.push('');
if(model.type===BaseModel.TYPE_RESOURCE){
lines.push('Creating a new resource is special because you also need to upload the file. Unlike other API calls, this one must have the "multipart/form-data" Content-Type. The file data must be passed to the "data" form field, and the other properties to the "props" form field. An example of a valid call with cURL would be:');
lines.push('The "data" field is required, while the "props" one is not. If not specified, default values will be used.');
lines.push('');
}
if(model.type===BaseModel.TYPE_TAG){
lines.push('## POST /tags/:id/notes');
lines.push('');
lines.push('Post a note to this endpoint to add the tag to the note. The note data must at least contain an ID property (all other properties will be ignored).');
lines.push('');
}
if(model.type===BaseModel.TYPE_NOTE){
lines.push('You can either specify the note body as Markdown by setting the `body` parameter, or in HTML by setting the `body_html`.');
lines.push('');
lines.push('Examples:');
lines.push('');
lines.push('* Create a note from some Markdown text');
lines.push('');
lines.push(' curl --data \'{ "title": "My note", "body": "Some note in **Markdown**"}\' http://127.0.0.1:41184/notes');
lines.push('');
lines.push('* Create a note from some HTML');
lines.push('');
lines.push(' curl --data \'{ "title": "My note", "body_html": "Some note in <b>HTML</b>"}\' http://127.0.0.1:41184/notes');
lines.push('');
lines.push('* Create a note and attach an image to it:');
lines.push('### Creating a note with a specific ID');
lines.push('');
lines.push('When a new note is created, it is automatically assigned a new unique ID so **normally you do not need to set the ID**. However, if for some reason you want to set it, you can supply it as the `id` property. It needs to be a 32 characters long hexadecimal string. **Make sure it is unique**, for example by generating it using whatever GUID function is available in your programming language.');
lines.push('');
lines.push(' curl --data \'{ "id": "00a87474082744c1a8515da6aa5792d2", "title": "My note with custom ID"}\' http://127.0.0.1:41184/notes');
lines.push('');
}
lines.push('## PUT /'+tableName+'/:id');
lines.push('');
lines.push('Sets the properties of the '+singular+' with ID :id');
lines.push('');
lines.push('## DELETE /'+tableName+'/:id');
lines.push('');
lines.push('Deletes the '+singular+' with ID :id');
return_("Gets or sets a config value. If [value] is not provided, it will show the value of [name]. If neither [name] nor [value] is provided, it will list the current configuration.");
return_('Gets or sets a config value. If [value] is not provided, it will show the value of [name]. If neither [name] nor [value] is provided, it will list the current configuration.');
}
options(){
return[
['-v, --verbose',_('Also displays unset and hidden config variables.')],
];
return[['-v, --verbose',_('Also displays unset and hidden config variables.')]];
['--note <note>',_('Exports only the given note.')],
['--notebook <notebook>',_('Exports only the given notebook.')],
];
return[['--format <format>',_('Destination format: %s',formats.join(', '))],['--note <note>',_('Exports only the given note.')],['--notebook <notebook>',_('Exports only the given notebook.')]];
}
asyncaction(args){
letexportOptions={};
exportOptions.path=args.path;
@@ -37,25 +30,20 @@ class Command extends BaseCommand {
@@ -10,7 +10,6 @@ const { time } = require('lib/time-utils.js');
const{cliUtils}=require('./cli-utils.js');
classCommandextendsBaseCommand{
usage(){
return'ls [note-pattern]';
}
@@ -22,16 +21,9 @@ class Command extends BaseCommand {
enabled(){
returnfalse;
}
options(){
return[
['-n, --limit <num>',_('Displays only the first top <num> notes.')],
['-s, --sort <field>',_('Sorts the item by <field> (eg. title, updated_time, created_time).')],
['-r, --reverse',_('Reverses the sorting order.')],
['-t, --type <type>',_('Displays only the items of the specific type(s). Can be `n` for notes, `t` for to-dos, or `nt` for notes and to-dos (eg. `-tt` would display only the to-dos, while `-ttd` would display notes and to-dos.')],
['-f, --format <format>',_('Either "text" or "json"')],
['-l, --long',_('Use long list format. Format is ID, NOTE_COUNT (for notebook), DATE, TODO_CHECKED (for to-dos), TITLE')],
];
return[['-n, --limit <num>',_('Displays only the first top <num> notes.')],['-s, --sort <field>',_('Sorts the item by <field> (eg. title, updated_time, created_time).')],['-r, --reverse',_('Reverses the sorting order.')],['-t, --type <type>',_('Displays only the items of the specific type(s). Can be `n` for notes, `t` for to-dos, or `nt` for notes and to-dos (eg. `-tt` would display only the to-dos, while `-ttd` would display notes and to-dos.')],['-f, --format <format>',_('Either "text" or "json"')],['-l, --long',_('Use long list format. Format is ID, NOTE_COUNT (for notebook), DATE, TODO_CHECKED (for to-dos), TITLE')]];
}
asyncaction(args){
@@ -93,7 +85,7 @@ class Command extends BaseCommand {
@@ -18,9 +14,7 @@ class Command extends BaseCommand {
}
options(){
return[
['-f, --force',_('Deletes the notes without asking for confirmation.')],
];
return[['-f, --force',_('Deletes the notes without asking for confirmation.')]];
}
asyncaction(args){
@@ -32,10 +26,9 @@ class Command extends BaseCommand {
constok=force?true:awaitthis.prompt(notes.length>1?_('%d notes match this pattern. Delete them?',notes.length):_('Delete note?'),{booleanAnswerDefault:'n'});
return_('<tag-command> can be "add", "remove" or "list" to assign or remove [tag] from [note], or to list the notes associated with [tag]. The command `tag list` can be used to list all the tags.');
return_('<tag-command> can be "add", "remove" or "list" to assign or remove [tag] from [note], or to list the notes associated with [tag]. The command `tag list` can be used to list all the tags (use -l for long option).');
}
options(){
return[['-l, --long',_('Use long list format. Format is ID, NOTE_COUNT (for notebook), DATE, TODO_CHECKED (for to-dos), TITLE')]];
@@ -44,11 +43,11 @@ class NoteWidget extends TextWidget {
}elseif(this.noteId_){
this.doAsync('loadNote',async()=>{
this.note_=awaitNote.load(this.noteId_);
if(this.note_&&this.note_.encryption_applied){
this.text=_('One or more items are currently encrypted and you may need to supply a master password. To do so please type `e2ee decrypt`. If you have already supplied the password, the encrypted items are being decrypted in the background and will be available soon.');
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.