# ME-Mydoc documentation

## Reference

## Launch

- Bundle types

  ME-Mydoc is distributed in two modes: platform independent and platform dependent. The platform dependent package contains the JRE on that platform whereas independent package can be executed on any platform as long as JRE/JDK 8 is installed.

- For platform dependent package, unzip it and execute corresponding launcher

  On Windows, launch mydoc.exe or mydoc.bat

  On Linux or Mac, launch mydoc.sh. Likely you need to invoke chmod +x mydoc.sh.

- For platform independent package, an extra step of setting up java command into PATH is required

  On Windows, set PATH=<your java path>;%PATH%

  On Linux or Mac, export PATH=<your java path>:$PATH. You may need to invoke chmod +x -R <jre folder>.

## Configuration

- Setup path on first use

> By default, user can click Install button to proceed. The directories will be created before the application starts. User can also change one or all directories according to his need.

Note path | directory where note files are stored
Doc path | directory where document files are stored
Bookshelf path | directory where book files are stored
Code path | directory where code files are stored
Search cache path | directory where search index caches are stored
Temp path | directory where temporary files are stored
Trash path | directory where deleted files are transferred to

## Search Window

- Global hot key that pops up/hides Floating Search Window

> `Ctrl + Alt + O` : Show/Hide Floating Search Window

- Keys in text input of floating window

`ESC` | Clear text if any. Hide window if text is empty.
`Arrow Down` | Goto result list if visible, or force to show result list.
`Enter` | Launch first item in the result list.
`Double Click` an item | Launch first item in the result list.
`Ctrl + Double Click` an item | Show property window for the item.
`Ctrl + Enter` an item | Show property window for the item.

## Search Query Rules

- Use `,` to separate AND conditions. For example, java,programming searches all items whose title has both java and programming.
- Types can be specified. Currently, there are following types.

`b:` | Book
`n:` | Note
`d:` | Doc
`c:` | Code
`t:` | Tag

> By default, items of only enabled types (in menu View ‣ Doc, View ‣ Note, View ‣ Book) are listed.

> For example, java,security,b: lists all books containing java and security. It is also equivalent to b:java,b:security or b:java,security.

- Use ## to specify full text search. For example, #java# searches all entities having java in its content. d:#java# searches Doc having java in its content. Actually, the query string inside ## follows Lucene query parser syntax.
- Multiple types are not valid except tag. For example, t:alg,b:math searches all books that belong to any tag having substring of alg and whose title has substring of math.

## Manage Tags

- All books, notes and docs can be tagged.
- Upon installation, there are pre-defined tags. “Ebook” tag is for Book categories and “Programming Languages” is for Code feature.
- User can of course create his own tags by right clicking a tag node

> Note that deleting a tag requires no items are associated with the tag.

## Add a Doc

- You can drag and drop a file from OS file manager to the Floating Search Window to create a new Doc or select menu File ‣ Add Doc or press `Ctrl + Alt + D` when main mydoc window is activated.

- Multiple files can be committed by clicking Choose button.
- Modify tags by clicking edit link in Tags field

- Published Time follows format YYYY, or YYYY-MM or YYYY-MM-DD
- In case that an existing file to be committed is identified (md5 match), you are given a chance to cancel. You can double click an item in the list and its property window is popped up.

## Add a Note

- There is a global hot key `Ctrl + Alt + N` that triggers creating a new note
- There are 4 components in the note editing window. On the right hand side is the source code view. On the left hand side are property view, toolbar and html view respectively.

- User can toggle between a minimal mode and a normal mode. In the minimal mode, only html view is displayed, providing user largest editing view.

- Or normal mode with property and toolbar

- Special toolbar buttons

> They are described as below

| Switch to source editing mode. Highlight source code
| Switch to source editing mode. Render AsciiMath
| Switch to minimal mode
| Toggle property area
| Toggle source editing area
| Convert selected text to a hyper link
| Insert image link
| Convert selected text to code
| Sync html view with html source code ( left-> right)
| Refresh all views.
| Sync html source code with its view ( right-> left)

- In html view, there are following shortcuts.

`ESC` | Close the window and discard changes. If the note is newly created, it’s not saved at all.
`Alt + S` | Save changes but keep window
`F2` | Switch minimal/full mode
`F5` | Refresh
`F6` | Insert entity reference
`F9` | Decrease font size
`F10` | Increase font size

- In html source editing view, there are following shortcuts.

`Alt + S` | Save changes and refresh html view
`F5` | Refresh html view

- Entity Cross Reference The search input is triggered by `F6`. You can launch the entity referenced by clicking it.

Note

You need to refresh html view once link, image, or entity cross reference is inserted before clicking to launch it.

- Code highlighting and AsciiMath representation

> You can mix both of them

> The saved html node can be rendered by common web browser.

Note

Once either of them is enabled, the html view becomes read only and you can only edit in html source editing view.

## Add a Code

- A code entity can have multiple snippets associated with it. Each snippet is just some text, highlighted in the editing view by a programming language specified.

- To create a new snippet, click New in Snippets field.
- By default, Java is the programming language for a newly created snippet. To change it, click edit in Languages field.

- To activate a snippet, select Snippets ‣ <the snippet>.

- To toggle property view, select Config ‣ Show Property.
- To change keymap, select Config ‣ Default Keymap or Config ‣ Vim Keymap

## Add a Book

- To create a new Book, follow menu File ‣ Add Book or press `Ctrl + Alt + B` when main mydoc window is activated.

- In case that an existing book file to be committed is identified (md5 match), you are given a chance to cancel. You can double click an item in the list and its property window is popped up.

- In the field Title, input in format Title:Subtitle so that title and subtitle can be recognized automatically.

> Double clicking an existing title, you can tweak other parts. To delete one, select and press `DEL`.

- In Tag list, double clicking the blank line brings up Select Tags window. Switch to All Tags switches to all-tag tree. Double click a tag in list and the candidate tag is removed.

- In Authors field, input full name and its first name, middle name and last name are parsed. If an author with same first name and last name exist, Select an existing author dialog is popped up. Clicking Cancel creates a new author,

- If you want to have a deep search of existing author, click Select Existing.

- Published Date follows format YYYY, or YYYY-MM or YYYY-MM-DD
- In Publishers list, double clicking the blank line brings up Select Publishers window.

- To add new publishers, select Edit ‣ Publishers

- A Book item can comprise more than one files. Press Add Files to add more.

## Search Hit Highlighting

## View Control

> In menu View, there are options described below

View ‣ Show Tag | Show items only associated with selected tag
View ‣ Show Sub Tags | Show items that belong to any decendents of the selected tag
View ‣ Show Favourite | Show favourite items. Note changing tag will not change
View ‣ Show No Tag | Show items that do not have any tag
View ‣ Show All | Show all items
View ‣ Doc | Show Doc items. Also controls items listed in Floating Search Window
View ‣ Note | Show Note items. Also controls items listed in Floating Search Window
View ‣ Book | Show Note items. Also controls items listed in Floating Search Window
View ‣ Code | Show Code items. Also controls items listed in Floating Search Window

## Options

- Enable Full Text Search : When enabled, new entities will be indexed once managed. It triggers indexing confirmation dialog, allowing user to perform full indexing or incremental indexing immediately.

- Copy before opening : When selected, the launched Doc will be copied to temp directory configured by user and then default program is invoked to open the shadow file, in order to avoid damage to the file.
- Show hidden : Users can mark hidden property of Doc or Note so that they will not be listed in main window or floating search window if Show hidden is disabled.
- Move to Trash : When enabled, deleted items are moved to trash folder in stead of vanishing completely.

## Launch item

- Opening an item can be triggered by pressing `Enter` or `Double Click` an item in either search popup list or main window list.
- Property window can be triggered by pressing `Ctrl + Enter` or `Ctrl + Double Click` an item in either search popup list or main window list.
- Doc property window

- Note property window

- Book property window

> Double clicking a file in Files list launches the book file.

## Misc

- Favourite

  Items can be added into favourite list by selecting menu item Action ‣ Favourite

- Deleting items

  Items can be deleted by selecting Action ‣ Delete. The deleted items are moved to trash directory if configured by user.

- Enlarge floating search input

  Drag floating search window right edge, the input will be enlarged or shrinked accordingly.