├── .gitignore ├── CHANGELOG.org ├── Development-Notes.org ├── LICENSE ├── Makefile ├── README.org ├── images ├── 7d1dba05-89ff-4f0f-9406-087e65a304e7.png ├── autocompletion.png ├── org-wiki-desc.png ├── org-wiki-find-dired.png ├── org-wiki-helm.gif ├── org-wiki-index.gif ├── org-wiki-index.png ├── org-wiki-insert-block.png ├── org-wiki-insert-latex1.png ├── org-wiki-insert-latex2.png ├── org-wiki-insert-symbol.png ├── org-wiki-insert.gif ├── org-wiki-keywords.png ├── org-wiki-menu1.png ├── org-wiki-menu2.png ├── wiki-dired-all.png ├── wiki-dired.png ├── wiki-helm-command.png └── wiki-search-pattern.png ├── org-wiki.el └── sandbox ├── README.org ├── init.el ├── sandbox.sh └── wiki ├── Avionics.org ├── Avionics ├── 63da7880-5005-4c6b-8497-bcd28d973a59.png ├── 9d8128e1-eed1-4212-bf9e-bf5eb50eb0ef.png └── a26fbbfb-6493-4d0d-bc99-98dda41f3a74.png ├── Bash - Shell - Unix.org ├── Circuit Boards.org ├── Circuit Boards ├── b977882e-35ee-4d3a-8d46-59931ae04aeb.png └── rasberry pi circuit board.png ├── Elisp.org ├── Linux.org ├── Linux └── Linux-Reference-Cheat-Sheet.pdf ├── Lisp Machines.org ├── Lisp Machines ├── 90d582b2-e81d-46ba-916d-bd1ca0334e24.png ├── Lisp machine from late 1970.png ├── lambda calculus.png └── what is a lisp machine.png ├── Math - Calculus.org ├── Python.org ├── Python ├── 70d62de1-b649-4651-b810-51844ea09ac5.png └── python icon test.png ├── Quotes.org ├── The Art of Unix Programming.org ├── The Art of Unix Programming ├── 500f61dd-afb2-41ca-83e6-0742fcbdce86.png ├── 7ef13361-0a05-410d-a4c1-e4cc90c4a644.png ├── 9dfb3b14-9ea4-4ea5-aaaf-1bd05eab6e96.png ├── An unix emulator.png └── d4499b37-fbf6-476f-812d-63d8ea88241d.png ├── index.org ├── index ├── fc0e0018-5a55-4f71-9c84-3d01a1cd46e4.png └── scala logo.png ├── ltximg ├── org-ltximg_3ea6764663d441dda6304b7781dcbe0bd5ae1322.png └── org-ltximg_ce4ae9de4baa41059dfda725c807905761b3d088.png └── theme ├── org-info.js ├── org-nav-theme.css ├── org-nav-theme.js ├── style.css ├── style.org └── style2.css /.gitignore: -------------------------------------------------------------------------------- 1 | /theme/style.html 2 | /README.html 3 | /README.html~ 4 | /org-wiki.elc 5 | /migtration-checklist.org 6 | *.elc 7 | *.pyc 8 | *.bin 9 | /dist/ 10 | *.exe 11 | *.so 12 | *.tgz 13 | *.zip 14 | /#org-wiki.el# 15 | *~ 16 | elpa 17 | tmp 18 | /sandbox/network-security.data 19 | /sandbox/custom.el 20 | #* 21 | \\#* 22 | *.html 23 | #* 24 | elpa* 25 | -------------------------------------------------------------------------------- /CHANGELOG.org: -------------------------------------------------------------------------------- 1 | * Changelog 2 | *** version 4.2 3 | *** version 5.0 - 4 | 5 | - Rename command org-wiki-insert to org-wiki-insert-link 6 | - Rename command org-wiki-create to org-wiki-insert-new 7 | - Replace org-wiki-make-page with org-wiki-new 8 | - Create command org-wiki-new 9 | - Create command org-wiki-switch-root 10 | - Remove custom variable org-wiki-location. 11 | - Add custom variable org-wiki-location-list to support multiple 12 | root directories. 13 | - Add command org-wiki-insert-symbol to insert symbols such as α, ∫, 14 | Δx, Ω, ¾ ... 15 | - Add command org-wiki-insert-block 16 | *** version 5.1 17 | - Fix bugs in the function org-wiki-insert-latex. 18 | - Add new latex templates in the command org-wiki-insert-latex. 19 | - Add new tips and tricks. 20 | 21 | 22 | -------------------------------------------------------------------------------- /Development-Notes.org: -------------------------------------------------------------------------------- 1 | #+TITLE: Development Notes 2 | #+STARTUP: contents 3 | 4 | 5 | * Development Notes 6 | ** TODO Tasklist 7 | 8 | - Document the API for developers and Add development Notes 9 | 10 | - Organize the API building a better abstraction and eliminating 11 | repeated code. 12 | 13 | - Add code exaples with IELM output and show how it works. 14 | 15 | - Add backend to extract metadata. 16 | 17 | - Goals: 18 | 19 | - Build a small database that allows the user to search metadata 20 | in a fast way. 21 | 22 | - Search pages by title 23 | 24 | - Search pages by tags 25 | 26 | - Search pages by tags and titles 27 | 28 | - Requirements: 29 | - Self contained script language 30 | - Small and easy to install and easy to distribute as an self-contained 31 | executable. 32 | - Fast startup time 33 | - Support to sqlite 34 | - Better candidate seems to be Python or Racket-scheme 35 | 36 | - Add automatic header creation. 37 | 38 | - Update GIFs 39 | 40 | - Add clip.jar utility as a GIT submodule 41 | 42 | - Create a dired or magit-like interface to browse the notes. 43 | 44 | ** API Diagram 45 | 46 | 47 | #+BEGIN_SRC text 48 | Current Buffer 49 | --------------------------- 50 | 51 | +-------> org-wiki-buffer-is-page-p 52 | / Test if current buffer is a org-wiki page 53 | / 54 | +--------------+----------> org-wiki-buffer-pagename 55 | | | Get page name of current buffer 56 | | Current + 57 | | Buffer |----------> org-wiki-buffer-directory 58 | | | Get asset/attachment directory of a org-wiki buffer 59 | +--------------+ 60 | 61 | 62 | 63 | Operations with org-wiki buffers 64 | -------------------------------- 65 | 66 | +---------------------+------------> Close all org-wiki buffers and saving them. 67 | | org-wiki-buffers | 68 | | +------------> Return all buffers belonging to org-wiki 69 | | | 70 | +---------+-----------+------------> Switch between org-wiki buffers 71 | 72 | 73 | 74 | Operations with org-wiki files 75 | ------------------------------- 76 | 77 | 78 | +-------------------------------+--------> Get all org-wiki file names 79 | | | 80 | | | 81 | | org-wiki files in +--------> Open org-wiki page (org-mode file) in 82 | | org-wiki-location 104 | "~/Documents/wiki" 105 | ELISP> 106 | #+END_SRC 107 | 108 | ** Functions 109 | *** Name transformation 110 | **** org-wiki--page-list - Get all org-wiki pages 111 | 112 | - org-wiki--page-list() 113 | 114 | Show all org-wiki-pages. Example: 115 | 116 | #+BEGIN_SRC elisp 117 | ELISP> (org-wiki--page-list) 118 | 119 | ("Accounting" "Bash_Script" "Binary_Files_and_Econding" "Bookmark2" 120 | "Bookmarks" "Brazil_Income_Tax" "Business" "C_and_Cplus" 121 | "CalculosTrabalhistas" "Carros_Automoveis" "CatRepelent" "Cint_Root" 122 | ...) 123 | #+END_SRC 124 | **** org-wiki--page->file - Convert page name to file 125 | 126 | - org-wiki--page->file (pagename) 127 | 128 | Transforms a wiki page name into the corresponding file name. 129 | 130 | Example: 131 | 132 | #+BEGIN_SRC elisp 133 | ELISP> (org-wiki--page->file "Smalltalk programming") 134 | "~/Documents/wiki/Smalltalk programming.org" 135 | ELISP> 136 | #+END_SRC 137 | **** org-wiki--file->page - Convert file to page name 138 | 139 | - org-wiki--file->page (filename) 140 | 141 | Transforms the org-wiki file name into the corresponding page name. 142 | 143 | #+BEGIN_SRC elisp 144 | ELISP> (org-wiki--file->page (org-wiki--page->file "Smalltalk programming")) 145 | "Smalltalk programming" 146 | ELISP> 147 | #+END_SRC 148 | 149 | *** Current Page 150 | **** org-wiki--current-page - Get the page name of current org-wiki buffer 151 | 152 | - org-wiki--current-page() 153 | 154 | Example: 155 | 156 | #+BEGIN_SRC elisp 157 | ELISP> (buffer-file-name) 158 | "/home/archbox/Documents/wiki/Smalltalk programming.org" 159 | ELISP> 160 | 161 | ELISP> (org-wiki--current-page) 162 | "Smalltalk programming" 163 | ELISP> 164 | #+END_SRC 165 | 166 | **** org-wiki--current-page-asset-file - Get path to current page's asset file. 167 | 168 | Example: 169 | 170 | #+BEGIN_SRC elisp 171 | ELISP> (current-buffer) 172 | # 173 | 174 | ELISP> (org-wiki--current-page) 175 | "Smalltalk programming" 176 | ELISP> 177 | 178 | ELISP> (buffer-file-name) 179 | "/home/archbox/Documents/wiki/Smalltalk programming.org" 180 | 181 | ELISP> (org-wiki--current-page-asset-file "numerical-methods-in-smalltalk.pdf") 182 | "Smalltalk programming/numerical-methods-in-smalltalk.pdf" 183 | ELISP> 184 | #+END_SRC 185 | 186 | *** Asset files / Attachment files 187 | **** org-wiki--assets-get-dir - Get page's asset directory 188 | 189 | - org-wiki--assets-get-dir (pagename) 190 | 191 | Example: Get the Linux page's (file: Linux.org) asset directory. 192 | 193 | #+BEGIN_SRC elisp 194 | ELISP> (org-wiki--assets-get-dir "Linux") 195 | "~/Documents/wiki/Linux" 196 | ELISP> 197 | #+END_SRC 198 | 199 | Example: Open this directory: 200 | 201 | #+BEGIN_SRC elisp 202 | ELISP> (dired (org-wiki--assets-get-dir "Linux")) 203 | #+END_SRC 204 | **** org-wiki--asset-page-files - Get all asset files belonging to a page. 205 | 206 | Example: 207 | 208 | #+BEGIN_SRC elisp 209 | 210 | ELISP> (org-wiki--current-page) 211 | "Smalltalk programming" 212 | 213 | ELISP> (buffer-file-name) 214 | "/home/archbox/Documents/wiki/Smalltalk programming.org" 215 | ELISP> 216 | 217 | ELISP> (org-wiki--asset-page-files "Smalltalk programming") 218 | ("." ".." "extendingClasses-number1.gst" "gst.im" "numerical-methods-in-smalltalk.pdf" "smalltak1.st") 219 | 220 | #+END_SRC 221 | 222 | **** org-wiki--current-page-asset-dir - Get curren page's asset directory 223 | 224 | Example: 225 | 226 | #+BEGIN_SRC elisp 227 | ELISP> org-wiki-location 228 | "~/Documents/wiki" 229 | ELISP> 230 | 231 | ELISP> (buffer-file-name) 232 | "/home/archbox/Documents/wiki/Smalltalk programming.org" 233 | 234 | ELISP> (org-wiki--current-page) 235 | "Smalltalk programming" 236 | 237 | ELISP> (org-wiki--current-page-asset-dir) 238 | "~/Documents/wiki/Smalltalk programming" 239 | #+END_SRC 240 | 241 | 242 | *** Non categorized 243 | **** org-wiki-xdg-open - Open a file with default system app. 244 | 245 | - org-wiki-xdg-open (filename) 246 | 247 | Example: It will open the file manual.pdf with whatever PDF viewer is 248 | installed in the system such as Adobe Acrobat Reader or Foxit Reader. 249 | 250 | #+BEGIN_SRC elisp 251 | ELISP> (org-wiki-xdg-open "Linux/manual.pdf") 252 | #+END_SRC 253 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: build 2 | 3 | html := dist/index.html 4 | 5 | 6 | 7 | install: 8 | emacs --batch --eval "(package-install-file \"org-wiki.el\")" --kill 9 | 10 | # Rules to build documentation 11 | 12 | html: $(html) 13 | 14 | $(html): README.org 15 | emacs README.org --batch -q -f org-html-export-to-html --kill 16 | mv README.html index.html 17 | cp index.html dist/index.html 18 | 19 | html-open: $(html) 20 | firefox dist/index.html 21 | 22 | html-clean: 23 | rm -rf $(html) 24 | 25 | html-redo: 26 | rm -rf $(html) 27 | emacs README.org --batch -q -f org-html-export-to-html --kill 28 | mv README.html index.html 29 | cp index.html dist/index.html 30 | 31 | html-dist: html-redo 32 | cd dist && git add index.html 33 | mkdir -p dist/wiki 34 | cp -r -v sandbox/wiki/* dist/wiki 35 | cd dist && git add wiki 36 | cd dist && git commit -a -m "update html doc" 37 | cd dist && git push 38 | 39 | view-github: 40 | firefox https://caiorss.github.io/org-wiki 41 | 42 | view-wiki-github: 43 | firefox https://caiorss.github.io/org-wiki/wiki/index.html 44 | 45 | build: 46 | emacs -l ~/.emacs.d/init.el --batch -f batch-byte-compile org-wiki.el 47 | 48 | 49 | clean: 50 | rm -rf *.elc 51 | 52 | # Sandbox commands 53 | 54 | sandbox-run: 55 | @echo "Running sandbox" 56 | cd ./sandbox && sh sandbox.sh run 57 | 58 | sandbox-reload: 59 | @echo "Cleaning sandbox" 60 | rm -rf ./sandbox/elpa 61 | @echo "Running sandbox" 62 | cd ./sandbox && sh sandbox.sh run 63 | 64 | sandbox-clean: 65 | @echo "Cleaning sandbox" 66 | rm -v -rf ./sandbox/elpa 67 | -------------------------------------------------------------------------------- /README.org: -------------------------------------------------------------------------------- 1 | #+TITLE: org-wiki 2 | #+LANGUAGE: en 3 | #+OPTIONS: H:4 4 | #+KEYWORKDS: org-mode, orgmode, emacs, wiki, desktop, wiki, tools, notes, notebook 5 | #+STARTUP: contents 6 | 7 | #+HTML_HEAD: 8 | #+HTML_HEAD: 9 | 10 | 11 | * Org-wiki 12 | ** Overview 13 | 14 | Org-wiki is a org-mode extension that provides tools to manage and 15 | build [[https://en.wikipedia.org/wiki/Personal_wiki][personal wiki]] or _desktop wiki_ where each wiki page is a 16 | org-mode file. 17 | 18 | It provides a custom protocol ~wiki:keyword~ which creates like. When 19 | clicked this links creates the wiki file in the wiki directory with 20 | name ~keyword.org~. 21 | 22 | 23 | | Repository | https://github.com/caiorss/org-wiki | 24 | | Html documentation | https://caiorss.github.io/org-wiki/ | 25 | | | | 26 | 27 | *Features:* 28 | 29 | - A wiki system for Emacs. 30 | 31 | - Search wiki pages quickly. 32 | 33 | - Create new wiki pages fast. 34 | 35 | - Command to export all pages to html without block Emacs. M-x =M-x 36 | org-wiki/export-html-async= 37 | 38 | - Search wiki pages by its content. (grep) 39 | 40 | - org-mode protocol to create and open wiki pages. 41 | 42 | - org-mode protocol to open attachment/asset files with default 43 | system application. 44 | 45 | - Automatic download of attachment files with: 46 | - =M-x org-wiki-asset-download-insert1= 47 | - =M-x org-wiki-asset-download-insert2= 48 | 49 | Org-mode already has many features that makes it suitable to create a desktop 50 | wiki and store knowledge like: 51 | 52 | - Render Latex formulas. 53 | 54 | - Block codes (org-babel). 55 | 56 | - Fast navigation and editing 57 | 58 | - Support for tables 59 | 60 | - Ability to export to html and other formats. 61 | 62 | - Links to files, images, system commands and Elisp commands. 63 | 64 | 65 | *Note* It is only possible to show the video demonstrations in [[https://caiorss.github.io/org-wiki][html version.]] 66 | 67 | *Link formats* 68 | 69 | - =wiki:= 70 | 71 | Example: 72 | 73 | #+BEGIN_SRC org 74 | wiki:Linux 75 | or 76 | [[wiki:Linux]] 77 | or 78 | [[wiki:Linux][Linux]] 79 | #+END_SRC 80 | 81 | - =wiki-asset-sys:/= 82 | 83 | Example: 84 | 85 | #+BEGIN_SRC org 86 | wiki-asset-sys:Linux;LearnLinux.pdf 87 | or 88 | [[wiki-asset-sys:Linux;LearnLinux.pdf]] 89 | or 90 | [[wiki-asset-sys:Linux;LearnLinux.pdf][Book Learn Linux.pdf]] 91 | #+END_SRC 92 | 93 | It will open the file =~/wiki-directory/Linux/LearnLinux.pdf= with the 94 | default system application. 95 | 96 | ** FAQ 97 | 98 | *What is a personal wiki/ desktop wiki?* 99 | 100 | It is a digital notebook or a note taking app integrated with 101 | desktop. Some examples are [[http://zim-wiki.org][Zim Wiki]], [[https://en.wikipedia.org/wiki/Microsoft_OneNote][Microsoft OneNote]] and [[https://en.wikipedia.org/wiki/Tomboy_(software)][Tomboy (software)]]. 102 | 103 | *What org-wiki is not* 104 | 105 | - It is not a server wiki like [[https://en.wikipedia.org/wiki/MediaWiki][Mediawiki]] (Wikipedia Engine) or 106 | [[https://www.dokuwiki.org/dokuwiki][Dokuwiki]]. So it has no administrative panel and user account and so 107 | on. Despite it not be a server wiki, it can serve org pages (*.org 108 | files) exported html with Python3 web server help in read-only mode. 109 | 110 | *Why org-wiki?* 111 | 112 | Server wikis are hard to manage and install for a single user and 113 | requires installation of a web server like Apache, PHP and a database 114 | server like MySql or PostgresSQL. 115 | 116 | Desktop wikis like org-wiki, Zim, OneNote and Tomboy are easier to 117 | install and manage than server wikis and has less memory 118 | requirements. 119 | 120 | The problems of many wikis are the lack of a good text editor, 121 | extensibility and desktop integration. Org-wiki solves that by putting 122 | the Wiki inside the most awesome text editor: Emacs and everything is 123 | just one keybinding or one command away. Another advantage is the 124 | org-mode format and Emacs integration that provides fast editing, fast 125 | refactoring, headline folding, fast table manipulation, export to many 126 | formats like html, pdf and so on, Latex equations and literate 127 | programming in many languages like C, C++, Python, R and so on. 128 | 129 | You can see Org-mode Screencasts and reviews here: 130 | 131 | - http://orgmode.org/worg/org-tutorials/org-screencasts/ 132 | 133 | ** Demos 134 | 135 | - (1) Browsing Index: M-x org-wiki/index 136 | 137 | [[file:images/org-wiki-index.gif][file:images/org-wiki-index.gif]] 138 | 139 | 140 | - (2) M-x org-wiki/helm - Select a wiki page by name. 141 | 142 | [[file:images/org-wiki-helm.gif][file:images/org-wiki-helm.gif]] 143 | 144 | - (3) M-x org-wiki/insert Insert a link to wiki page at cursor position. 145 | 146 | [[file:images/org-wiki-insert.gif][file:images/org-wiki-insert.gif]] 147 | 148 | 149 | - (4) - M-x org-wiki/asset-insert Insert a link to a asset file that 150 | when clicked opens it with default system application. 151 | 152 | See video: [[http://i.imgur.com/KqqC7sY.mp4][M-x org-wiki/asset-insert]] 153 | 154 | #+BEGIN_HTML 155 | 157 | #+END_HTML 158 | 159 | - (5) - Org-wiki exported to HTML 160 | 161 | 162 | You can view a sample wiki exported to html here: 163 | 164 | - [[https://caiorss.github.io/org-wiki/wiki/index.html][Sample org-wiki exported to html]] 165 | 166 | - This sample wiki is available at [[https://github.com/caiorss/org-wiki/tree/master/sandbox/wiki][sandbox/wiki]] 167 | 168 | ** Screenshots 169 | 170 | - 1. Command =M-x org-wiki-index= Open the wiki index page (file index.org) 171 | 172 | [[file:images/org-wiki-index.png][file:images/org-wiki-index.png]] 173 | 174 | - 2. Command =M-x org-wiki-helm= Open a helm menu to select the wiki 175 | page to be opened. 176 | 177 | [[file:images/wiki-helm-command.png][file:images/wiki-helm-command.png]] 178 | 179 | - 3. =M-x org-wiki- [tab]= provides easy completion and 180 | discoverability to org-wiki commands. 181 | 182 | [[file:images/autocompletion.png][file:images/autocompletion.png]] 183 | 184 | - 4. =M-x org-wiki-dired= Open the org-wiki directory showing only 185 | the wiki pages (*.org files). 186 | 187 | [[file:images/wiki-dired.png][file:images/wiki-dired.png]] 188 | 189 | - 5. =M-x org-wiki-dired-all= Open the org-wiki directory showing all 190 | files. 191 | 192 | [[file:images/wiki-dired-all.png][file:images/wiki-dired-all.png]] 193 | 194 | - 6. =M-x org-wiki-search-pattern= Search for all wiki page that contains 195 | a pattern. (string or regex pattern). 196 | 197 | Example: The command =M-x org-wiki/search-patern - System.Windows= will search all 198 | files that contains "System.Windows string". 199 | 200 | [[file:images/wiki-search-pattern.png][file:images/wiki-search-pattern.png]] 201 | ** Workflow 202 | *** Switching wiki 203 | 204 | Now org wiki supports multiple wikis or root directories, but only 205 | one wiki can be used at a time. So, to switch wiki type: 206 | 207 | - =M-x org-wiki-switch-root= 208 | 209 | *** Create a page - way 1 210 | 211 | To create a page do: 212 | 213 | - 1. M-x org-wiki-index - It goes to the Org-wiki index page 214 | (index.org). 215 | 216 | - 2. Then run =M-x org-wiki-insert-new= and a page name like 'CNC - Computer Numerical Control' 217 | 218 | It will insert a hyperlink at point like: 219 | 220 | #+BEGIN_SRC org 221 | [[wiki:CNC%20-%20Computer%20Numerical%20Control][CNC - Computer Numerical Control]] 222 | #+END_SRC 223 | 224 | - 3. Then click at the link or enter C-x C-o at the link to open it. 225 | 226 | *** Create a page - way 2 227 | 228 | Run =M-x org-wiki-new= and enter the page name, for instance 'Unix System Calls', 229 | it will create the file 'Unix System Calls.org' in the root directory 230 | and open it for editing. 231 | 232 | The advantage of creating a page using 'way 1' is that it inserts a 233 | link to the new created page before opening it, therefore making 234 | easier to categorize and navigate the pages. 235 | 236 | *** Browse a page 237 | 238 | The navigation can be done by running 239 | 240 | - =M-x org-wiki-index= It will open the index page which contains 241 | hyperlinks to other wiki pages. 242 | 243 | or 244 | 245 | - =M-x org-wiki-helm= that will show a helm combobox menu where the 246 | user view all pages and search a page by typing its name. 247 | 248 | or 249 | 250 | - =M-x org-wiki-helm-frame= to open a page in another frame (Emacs 251 | terminology for GUI window). 252 | 253 | ** Install 254 | *** Installation Methods 255 | **** Method 1 - Bootstrap installer 256 | 257 | Evaluate this code in the scratch buffer that will install all 258 | dependencies and this package. The scratch buffer can be evaluated 259 | with =M-x eval-buffer=. 260 | 261 | #+BEGIN_SRC elisp 262 | (let ((url "https://raw.githubusercontent.com/caiorss/org-wiki/master/org-wiki.el")) 263 | (with-current-buffer (url-retrieve-synchronously url) 264 | (goto-char (point-min)) 265 | (re-search-forward "^$") 266 | (delete-region (point) (point-min)) 267 | (kill-whole-line) 268 | (package-install-from-buffer))) 269 | #+END_SRC 270 | 271 | **** Method 2 - El-get 272 | 273 | Just copy this piece of code to scratch buffer and eveluate the buffer 274 | with =M-x eval-buffer=. It is assumed that [[https://github.com/dimitri/el-get][el-get]] is already installed. 275 | 276 | #+BEGIN_SRC elisp 277 | (el-get-bundle org-wiki 278 | :url "https://raw.githubusercontent.com/caiorss/org-wiki/master/org-wiki.el" 279 | :description "Emacs' desktop wiki built with org-mode" 280 | :features org-wiki 281 | ) 282 | #+END_SRC 283 | 284 | **** Method 3 - Manual installation 285 | 286 | Copy the package to the desired location. 287 | 288 | #+BEGIN_SRC sh 289 | mkdir -p ~/.emacs.d/packages/ 290 | 291 | cd ~/.emacs.d/packages/ 292 | 293 | git clone https://github.com/caiorss/org-wiki 294 | 295 | mkdir -p ~/org/wiki # Make wiki location. 296 | #+END_SRC 297 | *** Configuration 298 | **** Basic settings 299 | 300 | Make org-wiki directory 301 | 302 | - =M-x make-directory ~/org-wiki= 303 | 304 | Add to init file ~/.emacs.d/init.el or ~/.emacs 305 | 306 | #+BEGIN_SRC elisp 307 | (require 'org-wiki) 308 | #+END_SRC 309 | 310 | 311 | Org-wiki can configured programatically by setting the org-wiki custom 312 | varibles or with =M-x customize-group org-wiki=. 313 | 314 | **** Paths to Wiki locations 315 | 316 | This new version supports multiples org-wiki directories or multiple 317 | wikis in different directories, but only one wiki can be used at a 318 | time. The current wiki directory can be selected by using te command 319 | =M-x org-wiki-switch-root=. 320 | 321 | Paths where all org-wiki pages (*.org files) are stored. 322 | 323 | #+BEGIN_SRC elisp 324 | ;; 325 | ;; (setq org-wiki-location "~/org/wiki") 326 | 327 | (setq org-wiki-location-list 328 | '( 329 | "~/Documents/wiki" ;; First wiki (root directory) is the default. 330 | "~/Documents/wiki2 " 331 | "~/Documents/wiki3" 332 | )) 333 | 334 | ;; Initialize first org-wiki-directory or default org-wiki 335 | (setq org-wiki-location (car org-wiki-location-list)) 336 | #+END_SRC 337 | 338 | The default value of this variable is 339 | 340 | #+BEGIN_SRC elisp 341 | '("~/org/wiki") 342 | #+END_SRC 343 | 344 | In Windows it can be: 345 | 346 | - Note: backward slash in path \, must be escaped as \\ 347 | 348 | #+BEGIN_SRC elisp 349 | ;; (setq org-wiki-location "e:/projects/org-wiki-test.emacs") 350 | 351 | (setq org-wiki-location-list 352 | '( 353 | "C:\\Users\\john\\Documents\\wiki-main" ;; First wiki is the default. 354 | "F:/storage/wiki2" 355 | "G:\\Documents\\wiki3" 356 | )) 357 | #+END_SRC 358 | 359 | **** Open org-wiki pages in read-only 360 | 361 | If the custom variable =org-wiki-default-read-only= is set to true (t) 362 | org-wiki pages are opened in read-only mode. The default value of this 363 | variable is nil (false). It is useful to avoid unintended and 364 | accidental changings an org-wiki page. 365 | 366 | The read-only mode can be toggled with =M-x toggle-read-only= or C-x C-q. 367 | 368 | - Open org-wiki pages in read-only mode. 369 | 370 | #+BEGIN_SRC elisp 371 | (setq org-wiki-default-read-only t) 372 | #+END_SRC 373 | 374 | 375 | - Open org-wiki pages in non read-only mode. 376 | 377 | #+BEGIN_SRC elisp 378 | (setq org-wiki-default-read-only nil) ;; Default value 379 | #+END_SRC 380 | 381 | **** Close all wiki pages when switching wiki 382 | 383 | If the custom variable =org-wiki-close-root-switch= (default value 384 | true, t) is set to true, it will close all org-wiki pages of the 385 | current wiki (root path) before switching to another org-wiki 386 | location. 387 | 388 | Enable: 389 | 390 | #+BEGIN_SRC elisp 391 | (setq org-wiki-close-root-switch t) 392 | #+END_SRC 393 | 394 | Disable 395 | 396 | #+BEGIN_SRC elisp 397 | (setq org-wiki-close-root-switch nil) 398 | #+END_SRC 399 | 400 | **** Server settings 401 | 402 | Org-wiki can serve the pages exported to html with python help. 403 | 404 | The variable _org-wiki-server-port_ (default value 8000) sets the 405 | default port that Python web server will listen to. 406 | 407 | It can be set with: 408 | 409 | #+BEGIN_SRC elisp 410 | (setq org-wiki-server-port "8000") ;; 8000 - default value 411 | #+END_SRC 412 | 413 | The variable _org-wiki-server-host_ (default value 0.0.0.0 - all 414 | hosts) sets the host that the Python server will listen. 415 | 416 | It can be set with: 417 | 418 | #+BEGIN_SRC elisp 419 | (setq org-wiki-server-host "0.0.0.0") ;; Listen all hosts (default value) 420 | (setq org-wiki-server-host "127.0.0.1") ;; Listen only localhost 421 | #+END_SRC 422 | 423 | **** Export Settings 424 | 425 | In order to the html export work the path to emacs executable 426 | directory must be in the $PATH variable. In some OS like Windows where 427 | this path is not in $PATH variable it is necessary to set the variable 428 | =org-wiki-emacs-path= like: 429 | 430 | #+BEGIN_SRC elisp 431 | (setq org-wiki-emacs-path "c:/Users/arch/opt/emacs/bin/runemacs.exe") 432 | #+END_SRC 433 | 434 | 435 | Optional: This package provides the command =M-x org-wiki-make-menu= 436 | that installs a menu on the menu bar. 437 | 438 | The menu can be installed permanently by adding the init file: 439 | 440 | #+BEGIN_SRC elisp 441 | (org-wiki-make-menu) 442 | #+END_SRC 443 | 444 | **** Template 445 | 446 | The user can set the org-wiki template used to create org-wiki files 447 | by changing the custom variable with 448 | 449 | - =M-x customize-variable org-wiki-template= 450 | 451 | The default template is: 452 | 453 | #+BEGIN_SRC org 454 | ,#+TITLE: %n 455 | ,#+DESCRIPTION: 456 | ,#+KEYWORDS: 457 | ,#+STARTUP: content 458 | 459 | 460 | - [[wiki:index][Index]] 461 | 462 | - Related: 463 | 464 | ,* %n 465 | #+END_SRC 466 | 467 | where: 468 | 469 | - %n is replaced by the page name 470 | - %d is replaced by current date in the format year-month-day 471 | 472 | This variable can also be set programatically with: 473 | 474 | #+BEGIN_SRC elisp 475 | (setq org-wiki-template 476 | (string-trim 477 | " 478 | ,#+TITLE: %n 479 | ,#+DESCRIPTION: 480 | ,#+KEYWORDS: 481 | ,#+STARTUP: content 482 | ,#+DATE: %d 483 | 484 | - [[wiki:index][Index]] 485 | 486 | - Related: 487 | 488 | ,* %n 489 | ")) 490 | #+END_SRC 491 | 492 | *** Start the wiki 493 | 494 | - M-x org-wiki-index to go to index.org 495 | 496 | - New pages can be created with =M-x org-wiki-link= that asks for 497 | wiki word and inserts at point a hyperlink to the wiki page. 498 | 499 | - References to existing pages can be inserted with =M-x org-wiki-insert=. 500 | 501 | ** Command Summary 502 | 503 | | M-x Command | Description | 504 | |---------------------------------+---------------------------------------------------------------------------------------------------| 505 | | *Help* | | 506 | |---------------------------------+---------------------------------------------------------------------------------------------------| 507 | | | | 508 | | org-wiki-help | Show all org-wiki commands. | 509 | | org-wiki-website | Open org-wiki default website. | 510 | | | | 511 | | *Navigation* | | 512 | |---------------------------------+---------------------------------------------------------------------------------------------------| 513 | | org-wiki-switch-root | Switch between multiple org wikis listed in the variable 'org-wiki-location-list' | 514 | | org-wiki-index | Go to the index page or index.org | 515 | | org-wiki-index-frame | Open org-wiki index page in a new frame. | 516 | | org-wiki-switch | Switch between org-wiki buffers or already opened pages | 517 | | | | 518 | | org-wiki-helm | Open a org-wiki page | 519 | | org-wiki-helm-frame | Open a org-wiki page in a new frame | 520 | | org-wiki-helm-read-only | Open a org-wiki page in read-only mode | 521 | | | | 522 | | | | 523 | | *Close Command* | | 524 | |---------------------------------+---------------------------------------------------------------------------------------------------| 525 | | org-wiki-close | Close all buffers with files in org-wiki-location directory and save the editable buffers. | 526 | | org-wiki-close-images | Close all org-wiki image buffers. | 527 | | | | 528 | | *Insert Commands* | | 529 | |---------------------------------+---------------------------------------------------------------------------------------------------| 530 | | org-wiki-insert-new | Insert a link at point to a new org-wiki page. Click or follow the link to edit the new page. | 531 | | org-wiki-insert-link | Insert a link at point to an existing org-wiki page. | 532 | | org-wiki-header | Insert at the top of an org-wiki buffer an org-mode header template. | 533 | | | | 534 | | org-wiki-asset-insert-file | Insert link to asset/attachment file that can be opened with Emacs at point such as source codes. | 535 | | | | 536 | | org-wiki-asset-insert-image | Insert link to image file at point. | 537 | | | | 538 | | org-wiki-asset-insert | Insert a link to asset/attachment file at point. When the user clicks, | 539 | | | it opens with default system application. It is useful to open pdfs, | 540 | | | spreadsheets and so on. | 541 | | | | 542 | | org-wiki-asset-download-insert1 | Download a file and insert a link to it at point. Similar to org-wiki-asset-insert | 543 | | | | 544 | | org-wiki-asset-download-insert2 | Download a file and insert a link to it at point. Similar to org-wiki-asset-insert-file | 545 | | | | 546 | | org-wiki-insert-symbol | Insert Greek letters, math and physics symbols such as α, γ, Δ, Σ, ∞, ℉ | 547 | | org-wiki-insert-block | Insert quote block, source code code block, latex equation block and so on. | 548 | | org-wiki-insert-latex | Insert latex templates, formulas, Greek letters and math symbols. | 549 | | | | 550 | | *Directory* | | 551 | |---------------------------------+---------------------------------------------------------------------------------------------------| 552 | | org-wiki-dired | Open org-wiki-location or org-wiki storage directory in Emacs showing only *.org files. | 553 | | org-wiki-open | Open org-wiki-location with default system file manager. | 554 | | org-wiki-dired-all | OPen org-wiki-location showing all files. | 555 | | | | 556 | | *Alias Command* | | 557 | |---------------------------------+---------------------------------------------------------------------------------------------------| 558 | | org-wiki-nav | Alias to helm-org-in-buffer-headings | 559 | | org-wiki-occur | Alias to helm-occur | 560 | | org-wiki-toggle-images | Toggle images display. Alias to org-toggle-inline-images | 561 | | org-wiki-toggle-link | Toggle link display. Alias to M-x org-toggle-link-display. | 562 | | org-wiki-latex | Display latex formulas. Alias to org-preview-latex-fragment. Requires latex installed. | 563 | | | | 564 | | | | 565 | | *Backup Command* | | 566 | | org-wiki-backup-make | Create new zip file backup of all org-wiki files. | 567 | | org-wiki-backup-dir | Open backup directory. | 568 | | | | 569 | | *Misc* | | 570 | |---------------------------------+---------------------------------------------------------------------------------------------------| 571 | | org-wiki-panel | A panel like magit-status panel. | 572 | | org-wiki-server-toggle | Toggle Python web server. | 573 | | org-wiki-make-menu | Install an org-wiki menu. | 574 | | | | 575 | | | | 576 | 577 | Not complete yet. 578 | 579 | ** Commands 580 | *** Help 581 | 582 | - =M-x org-wiki-help= Show all org-wiki commands and its description. 583 | 584 | - =M-x org-wiki-website= Open org-wiki project website in the default 585 | web browser. 586 | 587 | *** Open the index page 588 | **** M-x org-wiki-index 589 | 590 | - =M-x org-wiki-index= - Open the index page. It opens the file 591 | index.org that is the first default page of the wiki. If the file 592 | doesn't exist it will be created. 593 | 594 | **** M-x org-wiki-index-frame 595 | 596 | - =M-x org-wiki-index-frame= - Open the wiki index page in a new frame. 597 | *** Pages 598 | **** M-x org-wiki-helm 599 | 600 | - =M-x org-wiki-helm= - Open a helm menu to switch or open a wiki page. 601 | 602 | **** M-x org-wiki-switch 603 | 604 | - =M-x org-wiki-switch= - Switch between org-wiki buffers (*.org 605 | files in org-wiki-location directory) already opened. 606 | 607 | **** M-x org-wiki-helm-frame 608 | 609 | - =M-x org-wiki-helm-frame= - Open a wiki page in a new frame. 610 | 611 | **** M-x org-wiki-helm-read-only 612 | 613 | - =M-x org-wiki-helm-read-only= - Open a wiki page in read-only 614 | mode. 615 | 616 | **** M-x org-wiki-make-page 617 | 618 | - =M-x org-wiki-make-page= - Creates a new wiki page asking the user 619 | for the page name. 620 | 621 | **** M-x org-wiki-close 622 | 623 | - =M-x org-wiki-close= - Close all wiki pages, kill all *.or buffers 624 | belonging to wiki directory. 625 | 626 | **** M-x org-wiki-close-image 627 | 628 | - Close all org-wiki image/picture buffers. 629 | 630 | *** Insert Hyperlink to wiki pages or asset files 631 | **** M-x org-wiki-insert-link 632 | 633 | - =M-x org-wiki-insert-link= - Asks the user for the wiki page name and 634 | inserts the hyperlink at point. It is useful to create new pages 635 | fast without write the full syntax like ~[[wiki:page title] [page title]~ 636 | 637 | Example: 638 | 639 | - 1. User enter M-x org-wiki-link and enter "The Art of Unix Programming" 640 | - 2. It will insert at point (current cursor position): 641 | 642 | #+BEGIN_SRC txt 643 | [[wiki:The%20Art%20of%20Unix%20Programming][The Art of Unix Programming]] 644 | #+END_SRC 645 | 646 | And will create the hyperlink to this page. 647 | 648 | **** M-x org-wiki-header 649 | 650 | - =M-x org-wiki-header. It inserts at top of the wiki page the template: 651 | 652 | #+BEGIN_SRC txt 653 | #+TITLE: 654 | #+DESCRIPTION: 655 | #+KEYWORDS: 656 | #+STARTUP: overview 657 | 658 | Related: 659 | 660 | [[wiki:index][Index]]\n\n 661 | #+END_SRC 662 | 663 | **** M-x org-wiki-asset-insert 664 | 665 | - =M-x org-wiki-asset-insert= - Insert a asset file at point 666 | providing a heml menu to select the file. It inserts a link of 667 | format ~wiki-asset-sys:CurrentPage;AssetFilename.pdf~. 668 | *** Asset files / Attachments 669 | **** Commands to open page's asset directory 670 | ***** M-x org-wiki-assets-dired 671 | 672 | Open page's asset directory in Emacs dired mode. 673 | ***** M-x org-wiki-assets-open 674 | 675 | - =M-x org-wiki-assets-open= - Open asset directory of current page 676 | with system's default file manager. 677 | 678 | ***** M-x org-wiki-assets-helm 679 | 680 | - =M-x org-wiki-assets-helm= - Select a wiki page and open its 681 | assets directory. 682 | 683 | **** Commands to insert hyperlink to files 684 | ***** M-x org-wiki-asset-create 685 | 686 | Prompts the user for a file name that doesn't exist yet and insert it 687 | at point. Unlike the commands `org-wiki-asset-insert` or ` 688 | org-wiki-asset-insert-file` this command asks the user for a file that 689 | doesn't exist yet and inserts a hyperlink to it at point. 690 | 691 | Example: If the user enter this command and he is in the page Linux 692 | and types scriptDemoQT.py it will insert a link at point like this 693 | file:Linux/scriptDemoQT.py that doesn't exist yet. The user can then 694 | open the link and edit the file. 695 | 696 | ***** M-x org-wiki-asset-insert 697 | 698 | - =M-x org-wiki-asset-insert= - Insert a link to asset file of current 699 | page at current cursor position. This link when clicked opens with 700 | default system application. 701 | 702 | Example: Inserts a a link such as the code below. User is in the page 703 | Linux and with this command selects in the Helm menu the file 704 | Manual.pdf. 705 | 706 | #+BEGIN_SRC 707 | [[wiki-asset-sys:Linux;Manual.pdf][Manual.pdf]] 708 | #+END_SRC 709 | 710 | ***** M-x org-wiki-asset-insert-file 711 | 712 | - =M-x org-wiki-asset-insert-file= - Insert a link to an asset file 713 | that can be opened with Emacs at cursor position. This is an 714 | ordinary org-mode link. 715 | 716 | Use this file for files supposed to be opened with Emacs such as 717 | Python, bash scripts or source codes. 718 | 719 | Note: Don't use this command to insert images, 720 | use =M-x org-wiki-insert-image= instead of this. 721 | 722 | Example: If the current page is Python and user selects the file 723 | pyscript.py it will insert a hyperlink at point as this. 724 | 725 | #+BEGIN_SRC org 726 | [[file:python/pyscript.py][pyscript.py]] 727 | #+END_SRC 728 | 729 | It will be rendenred as this: 730 | 731 | - [[file:python/pyscript.py][pyscript.py]] 732 | 733 | ***** M-x org-wiki-asset-insert-image 734 | 735 | - =M-x org-wiki-asset-insert-file= - Insert a link to an image file 736 | at point. 737 | 738 | Example: If the current page is Python and the user selects the file 739 | QTScreenshot.png it will insert a hyperlink to this file that will be 740 | rendered as an image when current page is exported to html. 741 | 742 | #+BEGIN_SRC org 743 | [[file:python/QTScreenshot.png][file:python/QTScreenshot.png]] 744 | #+END_SRC 745 | 746 | ***** M-x org-wiki-asset-insert-block 747 | 748 | Insert code block with contents of some asset file as an org-mode 749 | block: 750 | 751 | Example: 752 | 753 | If the current page is 'Smalltalk programming' it the user select the 754 | file 'extendingClasses-number1.gst' it will insert a code block with 755 | the file contents and a hyperlink to it at point. 756 | 757 | #+BEGIN_SRC org 758 | 759 | - File: [[file:Smalltalk%20programming/extendingClasses-number1.gst][file:Smalltalk programming/extendingClasses-number1.gst]] 760 | 761 | ,#+BEGIN_SRC text 762 | Number extend [ 763 | inv [ 1.0 / ^self 764 | ] 765 | 766 | neg [ - ^self 767 | ] 768 | ] 769 | ,#+END_SRC 770 | #+END_SRC 771 | 772 | It would insert a content like this: 773 | 774 | - File: [[file:Smalltalk%20programming/extendingClasses-number1.gst][file:Smalltalk programming/extendingClasses-number1.gst]] 775 | 776 | #+BEGIN_SRC text 777 | Number extend [ 778 | inv [ 1.0 / ^self 779 | ] 780 | 781 | neg [ - ^self 782 | ] 783 | ] 784 | #+END_SRC 785 | 786 | **** Commands to open files directly 787 | ***** M-x org-wiki-asset-find-file 788 | 789 | It will open a helm menu containing the assets files of current 790 | page. It will open the selected file with Emacs. 791 | 792 | Example: If the current page is 'Smalltalk programming' and the user select the 793 | file 'extendingClasses-number1.gst' it will open the file below with Emacs. 794 | 795 | - Smalltalk programming/'extendingClasses-number1.gst 796 | 797 | ***** M-x org-wiki-asset-find-sys 798 | 799 | Open a menu to select an asset file of current page and open it with 800 | system's app. 801 | 802 | Example: If the current page is 'Smalltalk programming' and the 803 | user select the file 'numerical-methods-in-smalltalk.pdf' it will 804 | be opened with the default system's application like Foxit PDF or 805 | Okular reader. 806 | 807 | **** Commands to Download Files 808 | ***** M-x org-wiki-asset-download-insert1 809 | 810 | - =M-x org-wiki-asset-download-insert1= - Ask the user the url to 811 | download a file suggesting the url stored in the clipboard and 812 | then asks the file name. After download it inserts a hyperlink at 813 | point to open the file with systems' default application. 814 | 815 | Example: 816 | 817 | 1. User is in the page Linux that corresponds to the file /Linux.org 818 | 819 | 2. User copy the url 820 | 821 | 822 | 3. User enter M-x org-wiki-asset-download-insert1 823 | 1. Confirm the first prompt asking for the url. The suggested url is the copied url. 824 | 2. Confirm the second prompt asking the file name. The suggested 825 | name is unix-concise-ref.pdf 826 | 827 | 4. It will insert at current point the hyperlink bellow. That points to the 828 | file /Linux/unix-concise-ref.pdf. 829 | 830 | #+BEGIN_SRC 831 | [[wiki-asset-sys:Linux;unix-concise-ref.pdf][unix-concise-ref.pdf]] 832 | #+END_SRC 833 | 834 | 835 | Note: This command is synchronous and it can hang Emacs, therefore 836 | downloading heavy files can freeze Emacs. If it happesn type C-g to 837 | cancel the current download. 838 | 839 | ***** M-x org-wiki-asset-download-insert2 840 | 841 | - =M-x org-wiki-asset-download-insert2= - Similar to =M-x 842 | org-wiki-asset-download-insert1=, however it inserts a hyperlink of 843 | type ~file:/~. 844 | 845 | Example: 846 | 847 | 1. User is in the page Linux and copies the url: 848 | ~http://i1-linux.softpedia-static.com/screenshots/htop_1.jpg~ 849 | 850 | 2. User enter the command M-x org-wiki-asset-download-insert1 and 851 | answers all prompts. 852 | 853 | 3. It will insert the hyperlink bellow at point. 854 | 855 | #+BEGIN_SRC 856 | file:Linux/htop_1.jpg 857 | #+END_SRC 858 | *** Open wiki directory 859 | **** M-x org-wiki-dired 860 | 861 | - =M-x org-wiki-dired= - Open the wiki directory in Emacs 862 | dired-mode showing only *.org files. 863 | 864 | **** M-x org-wiki-dired-all 865 | 866 | - =M-x org-wiki-dired-all= - Open the wiki directory in Emacs 867 | showing all files. 868 | *** Export all pages to html 869 | **** M-x org-wiki-export-html 870 | 871 | - =M-x org-wiki-export-html= - Exports all wiki pages to html 872 | asynchronously, it means withoyt block Emacs by starting a new 873 | Emacs process in background. 874 | 875 | **** M-x org-wiki-index-html 876 | 877 | - =M-x org-wiki-index-html= - Open the index page exported to html in 878 | the web browser. 879 | *** Search 880 | 881 | - =M-x org-wiki-search= - Search all wiki page that contains 882 | a pattern. (string or regex pattern). 883 | 884 | - =M-x org-wiki-find-dired= - Show all files in all org-wiki subdirectories. 885 | 886 | #+CAPTION: Screenshot of command M-x org-wiki-find-dired 887 | [[file:images/org-wiki-find-dired.png][file:images/org-wiki-find-dired.png]] 888 | 889 | - =M-x org-wiki-desc= - Show all org-wiki pages with description. 890 | 891 | #+CAPTION: Screenshot of command M-x org-wiki-desc 892 | [[file:images/org-wiki-desc.png][file:images/org-wiki-desc.png]] 893 | 894 | 895 | - =M-x org-wiki-keywords= - Display all org-wiki keywords and related 896 | org-wiki page files. 897 | 898 | #+CAPTION: Screenshot of command M-x org-wiki-keywords 899 | [[file:images/org-wiki-keywords.png][file:images/org-wiki-keywords.png]] 900 | *** Copy Commands 901 | 902 | - =M-x org-wiki-copy-location= - Copy org-wiki location path to clipboard. 903 | 904 | - =M-x org-wiki-copy-index-html= - Copy path of index page exported 905 | to html to clipboard. Example: //index.html 906 | 907 | - =M-x org-wiki-copy-asset-path= - Copy current page asset/attachment 908 | directory path to clipboard. Example: If the current page is Linux, 909 | it will copy the '//Linux/' to clipboard. 910 | 911 | *** M-x org-wiki-backup-make 912 | 913 | To create a backup run =M-x org-wiki-backup-make= it will create a 914 | file =org-wiki---.zip=, such as 915 | =org-wiki-2017-08-10.zip=, in the directory org-wiki-backup-location. 916 | 917 | *** M-x org-wiki-backup-dir 918 | 919 | To open the backup directory run M-x =org-wiki-backup-dir.= 920 | *** Utilities 921 | **** Insert greek letters, math, physics and currency symbols 922 | 923 | The command =M-x org-wiki-insert-symbol= allows inserting Greek 924 | letters, math and physics symbols by providing a helm menu where the 925 | user can select or type the name of the symbol to insert it at current 926 | point. It can be used to quickly type equations and formulas and can 927 | be pasted in email, forums, source code and etc. 928 | 929 | [[file:images/org-wiki-insert-symbol.png][file:images/org-wiki-insert-symbol.png]] 930 | 931 | Examples of symbols of provided: 932 | 933 | + α (alpha), β (beta), Σ (upper case sigma), σ (sigma) 934 | 935 | + π = 3.1415 -> Circle Area = π.r^2 936 | 937 | + ∂f/∂x + ∂f/∂y + ∂f/∂z = 0 938 | 939 | + ∛27 = 3.0, √100 = 10.0 940 | 941 | + 200.00 £ GBP, 3000.00 ¥ (Yuan, aka Reminbi) 942 | 943 | + Fractions ¼, ⅓, ⅑ 944 | 945 | **** Insert org-mode code blocks, tables, quotes and etc. 946 | 947 | This command makes easier to insert common org-mode code templates for 948 | code blocks, quote blocks, latex equations, table, example blocks and 949 | so on. 950 | 951 | - =$ M-x org-wiki-insert-block= 952 | 953 | [[file:images/org-wiki-insert-block.png][file:images/org-wiki-insert-block.png]] 954 | 955 | Example: 956 | 957 | If the user select the template _equation_ it will insert at current 958 | point a block for latex equations: 959 | 960 | #+BEGIN_SRC org 961 | \begin{equation} 962 | \end{equation} 963 | #+END_SRC 964 | 965 | If the user select the template _table_, it will insert a table with 2 966 | rows and 3 columns. 967 | 968 | #+BEGIN_SRC org 969 | | | | | 970 | |---+---+---| 971 | | | | | 972 | | | | | 973 | 974 | #+END_SRC 975 | 976 | If the user select the template Python code block, it will insert: 977 | 978 | #+BEGIN_SRC org 979 | ,#+BEGIN_SRC python 980 | 981 | ,#+END_SRC 982 | #+END_SRC 983 | 984 | **** Insert math formula, latex template, equations, greek letters and etc. 985 | 986 | The command =M-x org-wiki-insert-latex= allows writing Latex formulas, 987 | Greek letters and math symbolls quickly. It provides a helm menu where 988 | the user can type, search and insert Latex formulas at point. 989 | 990 | Example: 991 | 992 | [[file:images/org-wiki-insert-latex1.png][file:images/org-wiki-insert-latex1.png]] 993 | 994 | [[file:images/org-wiki-insert-latex2.png][file:images/org-wiki-insert-latex2.png]] 995 | 996 | **** Web Server 997 | 998 | - =M-x org-wiki-server-toggle= Start/stop static http server at 999 | org-wiki directory. 1000 | 1001 | This command actually runs =python -m http.server --bind = 1002 | at the org-wiki directory. So it requires Python installed and 1003 | available in the $PATH variable. 1004 | 1005 | Default value: 1006 | 1007 | - host: 0.0.0.0 1008 | - port: 8000 1009 | 1010 | To see your current local IP address type =M-x ifconfig=. You can 1011 | access the static web site by entering the URL: 1012 | 1013 | - ~http://:8000~ 1014 | 1015 | 1016 | - For instance: http://192.168.1.10:8000. 1017 | **** Panel - org-wiki-panel 1018 | 1019 | - =M-x org-wiki-panel= - This command provides a command panel that 1020 | can execute actions just typing few keys like magit or dired 1021 | buffer. 1022 | 1023 | [[file:images/7d1dba05-89ff-4f0f-9406-087e65a304e7.png][file:images/7d1dba05-89ff-4f0f-9406-087e65a304e7.png]] 1024 | 1025 | **** Menu 1026 | 1027 | - =M-x org-wiki-make-menu= Shows a menu with org-wiki functions and 1028 | command reminders. 1029 | 1030 | [[file:images/org-wiki-menu1.png][file:images/org-wiki-menu1.png]] 1031 | 1032 | [[file:images/org-wiki-menu2.png][file:images/org-wiki-menu2.png]] 1033 | **** Backup Commands 1034 | ***** Backup Settings 1035 | 1036 | Org-wiki can create backups of org-wiki snapshots stored in zip files 1037 | that can be useful to avoid losses or revert to a previous state. 1038 | 1039 | Set the org-wiki-backup directory. The variable 1040 | org-wiki-backup-location is initially set to nil. 1041 | 1042 | If the backup directory doesn't exist yet, it is created whenever the 1043 | user runs any backup command. 1044 | 1045 | Note: It is assumed that the =$ zip= command line application is the 1046 | $PATH variable. 1047 | 1048 | #+BEGIN_SRC elisp 1049 | (setq org-wiki-backup-location "~/Documents/org-wiki-backup") 1050 | #+END_SRC 1051 | **** Paste Image 1052 | ***** Overview 1053 | 1054 | This command requires the utility [[https://github.com/caiorss/clip.jar][clip.jar]] and Java runtime to be available 1055 | at the $PATH variable. 1056 | 1057 | The custom variable =org-wiki-clip-jar-path= holds the path to 1058 | clip.jar utility has the default value: =~/bin/Clip.jar=. 1059 | 1060 | If you wish to install in Clip.jar in a different path set the 1061 | variable org-wiki-clip-jar-path like this in the init file: 1062 | 1063 | #+BEGIN_SRC elisp 1064 | (setq org-wiki-clip-jar-path "~/bin/opt/Clip.jar") 1065 | #+END_SRC 1066 | 1067 | You can download a binary release with: 1068 | 1069 | #+BEGIN_SRC 1070 | mkdir ~/bin && cd ~/bin 1071 | curl -O -L https://github.com/caiorss/clip.jar/blob/build/Clip.jar 1072 | #+END_SRC 1073 | 1074 | ***** M-x org-wiki-paste-image 1075 | 1076 | - =M-x org-wiki-paste-image= Ask the user for the image file name and 1077 | writes the image from clipboard to the file. 1078 | 1079 | Example: 1080 | 1081 | + User copies an image with mouse right click to clipboard. 1082 | 1083 | 1084 | + User type the command M-x org-wiki-paste-image and choses the name 1085 | Unix.png and he is on the page Linux (Linux.org). It will write 1086 | the image to the file ./Linux/Unix.png and will insert a 1087 | this block at current cursor position: 1088 | 1089 | #+BEGIN_SRC 1090 | #+CAPTION: 1091 | file:Linux/Unix.png 1092 | #+END_SRC 1093 | 1094 | ***** M-x org-wiki-paste-image-uuid 1095 | 1096 | - =M-x org-wiki-paste-image-uuid= Paste an image from clipboard with 1097 | automatically generated name (uuid). 1098 | 1099 | Example: 1100 | 1101 | + User copies an image from clipboard and type the command 1102 | =M-x org-wiki-paste-image-uuid=. It will insert at point this block 1103 | containing a hyperlink to the image like: 1104 | 1105 | #+BEGIN_SRC 1106 | #+CAPTION: 1107 | file:Linux/fba53c12-3f23-4728-9f52-a26a3d285d7c.png 1108 | #+END_SRC 1109 | *** Alias Commands 1110 | 1111 | - =M-x org-wiki-nav= - Navigate through org-mode headings. Alias to 1112 | helm-org-in-buffer-headings. 1113 | 1114 | 1115 | - =M-x org-wiki-occur= - Alias to helm-occur. 1116 | 1117 | 1118 | - =M-x org-wiki-toggle-images= - Toggle images. Alias to M-x org-toggle-inline-images. 1119 | 1120 | 1121 | - =M-x org-wiki-toggle-link= - Toggle link display. Alias to M-x 1122 | org-toggle-link-display. 1123 | 1124 | 1125 | - =M-x org-wiki-latex= - Display latex formulas. Alias to M-x 1126 | org-preview-latex-fragment. It requires latex installed. 1127 | 1128 | ** Tips and tricks 1129 | *** Shortcuts 1130 | 1131 | You might want shortcuts for frequent commands: 1132 | 1133 | - Open a wiki page quickly. =M-x w-h= 1134 | 1135 | #+BEGIN_SRC elisp 1136 | (defalias 'w-h #'org-wiki-helm) 1137 | #+END_SRC 1138 | 1139 | - Switch between org-wiki buffers, wiki pages already opened. 1140 | 1141 | #+BEGIN_SRC elisp 1142 | (defalias 'w-s #'org-wiki-switch) 1143 | #+END_SRC 1144 | 1145 | - Open a wiki page in a new frame quickly. 1146 | 1147 | #+BEGIN_SRC elisp 1148 | (defalias 'w-hf #'org-wiki-helm-frame) 1149 | #+END_SRC 1150 | 1151 | - Switch to wiki page in read-only mode. 1152 | 1153 | #+BEGIN_SRC elisp 1154 | (defalias 'w-hr #'org-wiki-helm-read-only) 1155 | #+END_SRC 1156 | 1157 | - Go to the index page 1158 | 1159 | #+BEGIN_SRC elisp 1160 | (defalias 'w-i #'org-wiki-index) 1161 | #+END_SRC 1162 | 1163 | - Insert a link to a wiki page at point. It provides helm 1164 | completion. =M-x w-in= 1165 | 1166 | #+BEGIN_SRC elisp 1167 | (defalias 'w-in #'org-wiki-insert) 1168 | #+END_SRC 1169 | 1170 | - Open the current wiki page assets directory: =M-x w-ad= 1171 | 1172 | #+BEGIN_SRC elisp 1173 | (defalias 'w-ad #'org-wiki-asset-dired) 1174 | #+END_SRC 1175 | 1176 | - Export current wiki page to html or any org-mode file. =M-x og2h= 1177 | 1178 | #+BEGIN_SRC elisp 1179 | (defalias 'og2h #'org-html-export-to-html) 1180 | #+END_SRC 1181 | 1182 | - Close all wiki pages 1183 | 1184 | #+BEGIN_SRC elisp 1185 | (defalias 'w-close #'org-wiki-close) 1186 | #+END_SRC 1187 | 1188 | *** Screenshot tools 1189 | 1190 | *Linux* 1191 | 1192 | - [[http://shutter-project.org/][Shutter - Feature-rich Screenshot Tool]] 1193 | 1194 | - [[https://www.youtube.com/watch?v=Z7gci0qKCPo][Shutter - Advanced screenshot tool for Ubuntu ! - YouTube]] 1195 | 1196 | *Windows* 1197 | 1198 | - [[http://www.bleepingcomputer.com/tutorials/how-to-use-the-windows-snipping-tool/][How to use the Windows Snipping Tool]] 1199 | 1200 | *** Bookmarklets 1201 | 1202 | Bookmarklets are small pieces of Javascript used for browser 1203 | automation and as an ad-hoc browsers extensions, encoded as hyperlinks 1204 | that can be stored in the web browser's bookmark toolbar. 1205 | 1206 | If you don't kwnow what is a bookmarklet see: 1207 | 1208 | - [[https://www.youtube.com/watch?v=K_A3Y3eqnzE][Creating a Simple Bookmarklet - YouTube]] 1209 | 1210 | Note: The hyperlink of bookmarklet is only visible on the [[https://caiorss.github.io/org-wiki][html documentation.]] 1211 | 1212 | This bookmarklet opens a prompt and creates an org-mode hyperlink code 1213 | for the current web page. 1214 | 1215 | - To test the bookmarklet just click on it and copy the generated hyperlink. 1216 | 1217 | - To install the bookmarklet drag and drop the hyperlink to browser 1218 | bookmark toolbar. 1219 | 1220 | Bookmarklet: 1221 | 1222 | #+BEGIN_HTML 1223 | Org-mode Url 1224 | #+END_HTML 1225 | 1226 | Javascript code: 1227 | 1228 | #+BEGIN_SRC js 1229 | var md = "[[" + document.URL + "][" + document.title + "]]" ; 1230 | prompt("org-mode :", md); 1231 | #+END_SRC 1232 | 1233 | Compressed JavaScript code: 1234 | 1235 | #+BEGIN_SRC js 1236 | javascript:(function(){var md = "[[" + document.URL + "][" + document.title + "]]" ;prompt("org-mode :", md);})() 1237 | #+END_SRC 1238 | 1239 | More bookmarklets and cheat sheet available at: 1240 | 1241 | - https://github.com/caiorss/bookmarklet-maker 1242 | 1243 | and 1244 | 1245 | - https://caiorss.github.io/bookmarklet-maker/ 1246 | 1247 | *** Equation Rendering in Web browsers 1248 | 1249 | + TL;DR 1250 | - Formulas are displayed faster in Firefox. 1251 | - Mathml is the best Mathjax formula rendering. 1252 | 1253 | [[https://www.mathjax.org/][MathJax]] Latex rendering is slow in Chrome browser and in its 1254 | open-source relative Chromium browser. An alternative way to render 1255 | formulas faster is set MathJax to use [[https://en.wikipedia.org/wiki/MathML][mathml]] rendering, but it is not 1256 | well supported by all browsers such as Chrome e Internet Explorer. 1257 | Google has also dropped mathml supoort in new versions of the browser. 1258 | 1259 | So, until now, the best browser for fast displaying formulas and 1260 | equations is Firefox. 1261 | 1262 | Documentation related to Formulas and Latex backend: 1263 | 1264 | + [[https://www.gnu.org/software/emacs/manual/html_node/org/Math-formatting-in-HTML-export.html][Math formatting in HTML export - The Org Manual]] 1265 | 1266 | Online Equation Editors 1267 | 1268 | + http://www.codecogs.com/eqneditor 1269 | 1270 | + https://www.latex4technics.com/ 1271 | 1272 | + https://www.mathcha.io/ 1273 | 1274 | 1275 | See also: 1276 | 1277 | + CNET - [[https://www.cnet.com/news/google-subtracts-mathml-from-chrome-and-anger-multiplies/][Google subtracts MathML from Chrome, and anger multiplies]] 1278 | 1279 | *** Use the best tool of the job 1280 | **** Store, organize, and index documents, citations and etc. 1281 | 1282 | Those who need to store and index a large amount of any type of files 1283 | and documents will be better served with Zotero. 1284 | 1285 | - https://www.zotero.org/ 1286 | 1287 | 1288 | **** Write very formal thesis, paper, books, manuals and etc ... 1289 | 1290 | For this case one of the best tool is the open source software Lyx 1291 | that allows creating latex documents in a graphical way, in a similar 1292 | fashion to Microsoft Word and other word processors. It also has an 1293 | equation editor. 1294 | 1295 | - https://www.lyx.org/ 1296 | 1297 | *** Modify it 1298 | 1299 | You can change the commands or explore it using the command. 1300 | =M-x find-function = to open the file at the point where 1301 | the function is defined and edit the file org-wiki.el. 1302 | 1303 | Example: 1304 | 1305 | - M-x find-function =org-wiki-helm= 1306 | 1307 | - M-x find-library org-wiki 1308 | 1309 | ** TODOLIST 1310 | 1311 | - [x] - Add command to copy and paste images from clipboard. 1312 | - [] - Add this package to some Emacs repository. 1313 | - [x] - Add a runnable test. 1314 | - [x] - Add org-wiki example pages and generated html files. 1315 | - [] - Update gifs 1316 | 1317 | 1318 | 1319 | 1320 | -------------------------------------------------------------------------------- /images/7d1dba05-89ff-4f0f-9406-087e65a304e7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/images/7d1dba05-89ff-4f0f-9406-087e65a304e7.png -------------------------------------------------------------------------------- /images/autocompletion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/images/autocompletion.png -------------------------------------------------------------------------------- /images/org-wiki-desc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/images/org-wiki-desc.png -------------------------------------------------------------------------------- /images/org-wiki-find-dired.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/images/org-wiki-find-dired.png -------------------------------------------------------------------------------- /images/org-wiki-helm.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/images/org-wiki-helm.gif -------------------------------------------------------------------------------- /images/org-wiki-index.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/images/org-wiki-index.gif -------------------------------------------------------------------------------- /images/org-wiki-index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/images/org-wiki-index.png -------------------------------------------------------------------------------- /images/org-wiki-insert-block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/images/org-wiki-insert-block.png -------------------------------------------------------------------------------- /images/org-wiki-insert-latex1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/images/org-wiki-insert-latex1.png -------------------------------------------------------------------------------- /images/org-wiki-insert-latex2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/images/org-wiki-insert-latex2.png -------------------------------------------------------------------------------- /images/org-wiki-insert-symbol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/images/org-wiki-insert-symbol.png -------------------------------------------------------------------------------- /images/org-wiki-insert.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/images/org-wiki-insert.gif -------------------------------------------------------------------------------- /images/org-wiki-keywords.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/images/org-wiki-keywords.png -------------------------------------------------------------------------------- /images/org-wiki-menu1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/images/org-wiki-menu1.png -------------------------------------------------------------------------------- /images/org-wiki-menu2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/images/org-wiki-menu2.png -------------------------------------------------------------------------------- /images/wiki-dired-all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/images/wiki-dired-all.png -------------------------------------------------------------------------------- /images/wiki-dired.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/images/wiki-dired.png -------------------------------------------------------------------------------- /images/wiki-helm-command.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/images/wiki-helm-command.png -------------------------------------------------------------------------------- /images/wiki-search-pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/images/wiki-search-pattern.png -------------------------------------------------------------------------------- /org-wiki.el: -------------------------------------------------------------------------------- 1 | ;;; org-wiki.el --- Desktop wiki extension for org-mode -*- lexical-binding: t; -*- 2 | 3 | ;; Public Domain Software - Do whatever you want, use at will. 4 | 5 | ;; Author: Caio Rodrigues 6 | ;; Maintainer: Caio Rordrigues 7 | ;; Keywords: org-mode, wiki, notes, notebook 8 | ;; Version: 5.1 9 | ;; URL: https://www.github.com/caiorss/org-wiki' 10 | ;; Package-Requires: ((helm-core "2.0") (cl-lib "0.5")) 11 | 12 | 13 | ;; This is free and unencumbered software released into the public domain. 14 | ;; 15 | ;; Anyone is free to copy, modify, publish, use, compile, sell, or 16 | ;; distribute this software, either in source code form or as a compiled 17 | ;; binary, for any purpose, commercial or non-commercial, and by any 18 | ;; means. 19 | ;; 20 | ;; In jurisdictions that recognize copyright laws, the author or authors 21 | ;; of this software dedicate any and all copyright interest in the 22 | ;; software to the public domain. We make this dedication for the benefit 23 | ;; of the public at large and to the detriment of our heirs and 24 | ;; successors. We intend this dedication to be an overt act of 25 | ;; relinquishment in perpetuity of all present and future rights to this 26 | ;; software under copyright law. 27 | ;; 28 | ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 29 | ;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 30 | ;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 31 | ;; IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 32 | ;; OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 33 | ;; ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 34 | ;; OTHER DEALINGS IN THE SOFTWARE. 35 | ;; 36 | ;; For more information, please refer to 37 | 38 | ;;; Commentary: 39 | 40 | ;; Org-wiki is a org-mode extension that provides tools to manage and 41 | ;; build a desktop wiki where each wiki page is an org-mode file. 42 | ;; 43 | 44 | ;;; Code: 45 | 46 | ;; external libraries 47 | (require 'ox-html) 48 | (require 'helm) 49 | 50 | ;; built-in Emacs lib 51 | (require 'cl-lib) ;; Common-lisp emulation library 52 | (require 'easymenu) 53 | (require 'subr-x) ;; Provides string trim functions. 54 | 55 | ;; ****************** U S E R - S E T T I N G S ************************ ;; 56 | 57 | (defgroup org-wiki nil 58 | "Org-wiki Settings" 59 | :group 'tools 60 | ) 61 | 62 | (defcustom org-wiki-location-list '("~/org/wiki") 63 | "List of org-wiki root directories" 64 | :type '(repeat directory) 65 | :group 'org-wiki 66 | ) 67 | 68 | (defvar org-wiki-location nil) 69 | 70 | (defcustom org-wiki-default-read-only nil 71 | "If this variable is true all org-wiki pages will open as read-only by default. 72 | You can toggle read-only mode with M-x read-only-mode or C-x C-q." 73 | :type 'boolean 74 | :group 'org-wiki 75 | ) 76 | 77 | (defcustom org-wiki-close-root-switch t 78 | "If this variable is true, all org-wiki pages are closed when root directory is switched. 79 | (Default value: true)" 80 | :type 'boolean 81 | :group 'org-wiki 82 | ) 83 | 84 | 85 | 86 | ;;; ======= Python Webserver Settings =========== ;; 87 | 88 | (defcustom org-wiki-server-port "8000" 89 | "Default port to server org-wiki static files server." 90 | :type 'string 91 | :group 'org-wiki 92 | ) 93 | 94 | (defcustom org-wiki-server-host "0.0.0.0" 95 | "Default address that the server listens to." 96 | :type 'string 97 | :group 'org-wiki 98 | ) 99 | 100 | ;; ======== Async export settings ================ ;; 101 | 102 | (defcustom org-wiki-emacs-path "emacs" 103 | "Path to Emacs executable. Default value 'emacs'." 104 | :type 'file 105 | :group 'org-wiki 106 | ) 107 | 108 | ;;; Path to init file like init.el used by function org-wiki-html-export 109 | ;; The user can set for a more lightweight file in order to speed up the 110 | ;; exporting speed. 111 | ;; 112 | (defcustom org-wiki-user-init-file (concat (file-name-as-directory user-emacs-directory) "init.el") 113 | "Path to init.el file used for asynchronous export." 114 | :type 'file 115 | :group 'org-wiki 116 | ) 117 | 118 | 119 | ;; ====== Optional Clip.jar image pasting app =========== ;; 120 | (defcustom org-wiki-backup-location nil 121 | "Path to backup directory." 122 | :type 'directory 123 | :group 'org-wiki 124 | ) 125 | 126 | ;; Optional Clip.jar image pasting app 127 | (defcustom org-wiki-clip-jar-path "~/bin/Clip.jar" 128 | "Path to Clip.jar utility to paste images from clipboard." 129 | :type 'file 130 | :group 'org-wiki 131 | ) 132 | 133 | 134 | 135 | ;;; Default index page (index.org) accessed with M-x org-wiki-index 136 | ;; 137 | (defvar org-wiki-index-file-basename "index") 138 | 139 | 140 | ;;; Additional publishing options 141 | (defcustom org-wiki-publish-plist '() 142 | "Additional options passed to `org-publish'." 143 | :type 'plist 144 | :group 'org-wiki) 145 | 146 | 147 | (defcustom org-wiki-template 148 | (concat "#+TITLE: %n\n" 149 | "#+DESCRIPTION:\n" 150 | "#+KEYWORDS:\n" 151 | "#+STARTUP: content\n" 152 | "\n\n" 153 | "- [[wiki:index][Index]]\n\n" 154 | "- Related: \n\n" 155 | "* %n\n" 156 | ) 157 | "Default template used to create org-wiki pages/files. 158 | - %n - is replaced by the page name. 159 | - %d - is replaced by current date in the format year-month-day." 160 | 161 | :type 'string 162 | :group 'org-wiki 163 | ) 164 | 165 | ;; ********************** I N T E R N A L - F U N C T I O N S ************************* ;; 166 | ;; 167 | 168 | ;; @SECTION: Internal functionsq 169 | ;; 170 | (defun org-wiki--concat-path (base relpath) 171 | "Concat directory path (BASE) and a relative path (RELPATH)." 172 | (concat (file-name-as-directory base) relpath)) 173 | 174 | ;; Initialize org-wiki-location variable if not set yet. 175 | ;; 176 | (defun org-wiki--start-location () 177 | (if (not org-wiki-location) 178 | (setq org-wiki-location (car org-wiki-location-list)))) 179 | 180 | (defun org-wiki--get-buffers () 181 | "Return all org-wiki page buffers (.org) files in `org-wiki-location`." 182 | (org-wiki--start-location) 183 | (cl-remove-if-not (lambda (p) 184 | (let* ((fp (buffer-file-name p)) 185 | (fpath (if fp (expand-file-name fp) nil)) 186 | ) 187 | ;; path test if file exists (if fpath not nil) 188 | (and fpath 189 | ;; test if buffer file is in wiki location 190 | (string-prefix-p (expand-file-name org-wiki-location) fpath) 191 | ;; test if buffer file has extension .org 192 | (string-suffix-p ".org" fpath) 193 | ))) 194 | (buffer-list))) 195 | 196 | (defun org-wiki--normalize-path (path) 197 | "Replace double slashes for a single slash and remove slash at the end of a PATH." 198 | (replace-regexp-in-string 199 | "//" 200 | "/" 201 | (replace-regexp-in-string "/$" "" (expand-file-name path)))) 202 | 203 | (defun org-wiki--path-equal (p1 p2) 204 | "Test if paths P1 and P2 are equal." 205 | (equal (org-wiki--normalize-path p1) (org-wiki--normalize-path p2))) 206 | 207 | 208 | (defun org-wiki--file->page (filename) 209 | "Get a wiki page name from a FILENAME. 210 | Example: 211 | ELISP> (file->org-wiki--page \"Spanish.org\") 212 | \"Spanish\"" 213 | (file-name-base filename)) 214 | 215 | (defun org-wiki--replace-extension (filename extension) 216 | "Replace a FILENAME extension by an new EXTENSION. 217 | Example: 218 | ELISP> (org-wiki/replace-extension \"file.org\" \"html\" ) 219 | \"file.html\"" 220 | (concat (car (split-string filename "\\.")) 221 | "." 222 | extension 223 | )) 224 | 225 | 226 | (defun org-wiki--page->file (pagename) 227 | "Get the corresponding wiki file (*.org) to the wiki PAGENAME. 228 | Example: 229 | 230 | ELISP> (org-wiki--page->file \"Linux\") 231 | \"~/org/wiki/Linux.org\"" 232 | 233 | (concat (file-name-as-directory org-wiki-location) 234 | pagename 235 | ".org" 236 | )) 237 | 238 | (defun org-wiki--current-page () 239 | "Get current org-wiki page's name bound to current buffer." 240 | (org-wiki--file->page (buffer-file-name))) 241 | 242 | (defun org-wiki--current-page-asset-dir () 243 | "Get current org-wiki page's asset directory" 244 | (interactive) 245 | (concat (file-name-as-directory org-wiki-location) 246 | (file-name-base (buffer-file-name)))) 247 | 248 | (defun org-wiki--current-page-asset-file (filename) 249 | "Get current page's asset file path given its name. 250 | Example: If the current page is 'Smalltalk programming' 251 | 252 | ELISP> (org-wiki--current-page-asset-file \"manual.pdf\") 253 | \"Smalltalk programming/manual.pdf\" 254 | ELISP>" 255 | (concat (file-name-as-directory (file-name-base (buffer-file-name))) 256 | filename)) 257 | 258 | (defun org-wiki--buffer-file-in-wiki-p () 259 | "Return true if current buffer file name is inside wiki directory." 260 | (file-exists-p 261 | (org-wiki--concat-path 262 | org-wiki-location 263 | (file-name-nondirectory (buffer-file-name))))) 264 | 265 | (defun org-wiki--list-pages () 266 | "Return a list containing all pages files *.org." 267 | (directory-files org-wiki-location)) 268 | 269 | 270 | (defun org-wiki--page->html-file (pagename) 271 | "Convert a wiki PAGENAME to html file name." 272 | (concat (file-name-as-directory (expand-file-name org-wiki-location)) 273 | pagename 274 | ".html" 275 | )) 276 | 277 | (defun org-wiki--page-files (&optional abspath) 278 | "Return a list containing all files in the wiki directory. 279 | 280 | \(org-wiki--page-files &optional ABSPATH) 281 | 282 | if abspath is null returns relative path, otherwise returns the absolute path. 283 | 284 | Example: 285 | 286 | ELISP> (remove-if-not #'file->org-wiki/page (org-wiki/page-files)) 287 | (\"Abreviations_Slangs.wiki.org\" \"Android.wiki.org\" \"Bash_Script.wiki.org\")" 288 | (org-wiki--start-location) 289 | (cl-remove-if-not 290 | (lambda (s) 291 | (let ((b (file-name-base s))) 292 | (not (or 293 | (string-prefix-p ".#" b) 294 | (string-suffix-p "~" b ) 295 | (string-prefix-p "#" b) 296 | (string-suffix-p "#" b) 297 | )))) 298 | (directory-files org-wiki-location abspath "\\.org$"))) 299 | 300 | 301 | (defun org-wiki--page-list () 302 | "Return a list containing all wiki pages. 303 | Example: '(\"Linux\" \"BSD\" \"Bash\" \"Binary_Files\")" 304 | (mapcar #'org-wiki--file->page (org-wiki--page-files))) 305 | 306 | 307 | ;; @REVIEW: Function for future use. 308 | ;; 309 | ;; (defun org-wiki--get-page (wikipage) 310 | ;; (org-wiki--concat-path org-wiki-location 311 | ;; (replace-regexp-in-string "\s" "_" 312 | ;; (replace-regexp-in-string "%20" "_" 313 | ;; (concat wikipage ".org"))))) 314 | 315 | 316 | (defun org-wiki--assets-get-dir (pagename) 317 | "Get path to asset directory of given PAGENAME." 318 | (org-wiki--concat-path org-wiki-location pagename)) 319 | 320 | 321 | (defun org-wiki--assets-make-dir (pagename) 322 | "Create the asset directory of a wiki page (PAGENAME) if it doesn't exist. 323 | Example: (org-wiki--assets-make-dir \"Bash\") 324 | 325 | It will crate the directory ~/wiki-location/Bash/ 326 | corresponding to the file ~/wiki-location/Bash.org 327 | if it doesn't exist yet." 328 | (let ((assets-dir (org-wiki--assets-get-dir pagename))) 329 | (if (not (file-exists-p assets-dir)) 330 | (make-directory assets-dir t)))) 331 | 332 | 333 | (defun org-wiki--assets-buffer-make-dir () 334 | "Create asset directory of current buffer page if it doesn't exit." 335 | (if (org-wiki--buffer-file-in-wiki-p) 336 | (progn 337 | (org-wiki--assets-make-dir 338 | (file-name-base (buffer-file-name)))) 339 | (message "Error: Not in a wiki page."))) 340 | 341 | 342 | (defun org-wiki--is-buffer-in (b) 343 | "Check if buffer is an org-wiki buffer. 344 | It returns true (non nil) if buffer directory is a subdirectory of 345 | org-wiki-location." 346 | (string-prefix-p 347 | (expand-file-name org-wiki-location) 348 | (expand-file-name (with-current-buffer b 349 | default-directory)))) 350 | 351 | ;;=============== Org-mode custom protocol ===============;; 352 | ;; 353 | ;; @SECTION: Protocol 354 | 355 | (defun org-wiki--org-link (path desc backend) 356 | "Creates an html org-wiki pages when exporting to html. 357 | Example: The hyperlink [[wiki:Linux][Dealing with Linux]] 358 | will be exported to Dealing with Linux" 359 | (cl-case backend 360 | (html (format 361 | "%s" 362 | path 363 | (or desc path))))) 364 | 365 | (defun org-wiki--make-link (pagename) 366 | "Return a string containing a wiki link [[wiki:PAGENAME][PAGENAME]]. 367 | Example: if PAGENAME is Linux it will return [[wiki:Linux][Linux]]" 368 | (format "[[wiki:%s][%s]]" pagename pagename)) 369 | 370 | (defun org-wiki--open-page (pagename) 371 | "Open or create new a org-wiki page (PAGENAME) by name. 372 | Example: (org-wiki--open-page \"Linux\") 373 | Will open the the wiki file Linux.org in 374 | `org-wiki-location`" 375 | (let ((org-wiki-file (org-wiki--page->file pagename))) 376 | (if (not (file-exists-p org-wiki-file)) 377 | ;; Action executed if file doesn't exist. 378 | (progn (find-file org-wiki-file) 379 | ;; Insert header at top of page 380 | (org-wiki-header) 381 | ;; Save current page buffer 382 | (save-buffer) 383 | ;; Create assets directory 384 | (org-wiki--assets-make-dir pagename)) 385 | 386 | ;; Action executed if file exists. 387 | (if org-wiki-default-read-only 388 | ;; open file in read-only mode. 389 | (progn (find-file org-wiki-file) 390 | (read-only-mode 1)) 391 | ;; open file in writable mode. 392 | (find-file org-wiki-file)) 393 | ))) 394 | 395 | 396 | (defun org-wiki--assets-get-file (pagename filename) 397 | "Return a path to an asset file FILENAME in given PAGENAME." 398 | (org-wiki--concat-path (org-wiki--assets-get-dir pagename) filename)) 399 | 400 | (defun org-wiki--assets-open-file-emacs (pagename filename) 401 | "Open an asset file FILENAME of a PAGENAME with Emacs. 402 | 403 | Example: (org-wiki--assets-open-file-emacs \"Python\" \"example1.py\") 404 | It will open the file /Python/example1.py related to the page Python.org." 405 | (find-file (org-wiki--assets-get-file pagename filename))) 406 | 407 | 408 | (defun org-wiki-xdg-open (filename) 409 | "Open a file FILENAME with default system application. 410 | This function is operating system independent. 411 | 412 | Running in Linux or BSD invokes the script xdg-open 413 | Running in Windows invokes cmd.exe 414 | Running in Mac OSX invokes open" 415 | (cl-case system-type 416 | 417 | ;;; Linux 418 | (gnu/linux (let ((process-connection-type nil)) 419 | 420 | (start-process 421 | "proc" 422 | nil 423 | ;; Command 424 | "xdg-open" (expand-file-name filename)))) 425 | ;;; Free BSD OS 426 | (gnu/kfreebsd (let ((process-connection-type nil)) 427 | 428 | (start-process 429 | "proc" 430 | nil 431 | ;; Command 432 | "xdg-open" (expand-file-name filename)))) 433 | 434 | ;; Mac OSX - Tested. Ok. 435 | (darwin (start-process 436 | "proc" 437 | nil 438 | ;; Command 439 | "open" (concat (expand-file-name filename)))) 440 | 441 | ;; Windows 7, 8, 10 - Kernel NT 442 | (windows-nt (start-process 443 | "proc" 444 | nil 445 | ;; Command 446 | "cmd" "/C" "start" "" (expand-file-name filename)) 447 | 448 | ))) ;; End of org-wiki/xdg-open 449 | 450 | 451 | (defun org-wiki--protocol-open-assets-with-sys (link) 452 | "Org-mode protocol handler to open an asset with default system app. 453 | Example: it will turn a hyperlink LINK of syntax Blueprint;box1.dwg that 454 | points to the file /Blueprint/box1.dwg." 455 | 456 | (let* ((a (split-string link ";")) 457 | (pagename (car a)) 458 | (filename (cadr a)) 459 | ) 460 | (org-wiki-xdg-open 461 | (org-wiki--assets-get-file pagename filename)))) 462 | 463 | 464 | ;; @DONE: Implement html exporting to org-wiki asset files 465 | ;; 466 | (defun org-wiki--asset-link (path desc backend) 467 | "Creates an html org-wiki pages html exporting." 468 | (let* ((a (split-string path ";")) 469 | (page (car a)) 470 | (asset (cadr a)) 471 | (file-path (concat page "/" asset)) 472 | ) 473 | (cl-case backend 474 | (html (format 475 | "%s" 476 | file-path 477 | (or desc asset)))))) 478 | 479 | ;;; Custom Protocols 480 | (add-hook 'org-mode-hook 481 | (lambda () 482 | ;; Hyperlinks to other org-wiki pages 483 | ;; 484 | ;; wiki: or [[wiki:][]] 485 | (org-add-link-type "wiki" 486 | #'org-wiki--open-page 487 | #'org-wiki--org-link ) 488 | ;; Hyperlinks to asset files that are opened with system 489 | ;; applications such as spreadsheets. 490 | ;; 491 | ;; wiki-asset-sys:< 492 | (org-add-link-type "wiki-asset-sys" 493 | #'org-wiki--protocol-open-assets-with-sys 494 | #'org-wiki--asset-link))) 495 | 496 | (defun org-wiki--helm-selection (callback) 497 | "Open a helm menu to select the wiki page and invokes the CALLBACK function." 498 | (helm :sources `(( 499 | (name . "Wiki Pages") 500 | (candidates . ,(delete-dups (org-wiki--page-list))) 501 | (action . ,callback) 502 | )))) 503 | 504 | 505 | (defun org-wiki--asset-page-files (pagename) 506 | "Get all asset files from a given PAGENAME." 507 | (org-wiki--assets-make-dir pagename) 508 | (directory-files (org-wiki--assets-get-dir pagename))) 509 | 510 | 511 | (defun org-wiki--asset-helm-selection (callback) 512 | "Higher order function to deal with page assets. 513 | 514 | org-wiki-asset-helm-selection (CALLBACK) 515 | 516 | This function opens a helm menu to select a wiki page and then 517 | passes the result of selection to a callback function that takes 518 | a asset file as argument. 519 | 520 | Example: If the user selects the file freebsdref1.pdf it inserts the 521 | file name at current point. 522 | 523 | > (org-wiki--asset-helm-selection (lambda (file) (insert file))) 524 | freebsdref1.pdf" 525 | (helm :sources `(( 526 | (name . "Wiki Pages") 527 | (candidates . ,(org-wiki--asset-page-files 528 | (org-wiki--current-page))) 529 | (action . (lambda (file) 530 | (,callback (org-wiki--current-page-asset-file file)) 531 | )) 532 | )))) 533 | 534 | 535 | (defun org-wiki--asset-download-hof (callback) 536 | "Higher order function to download a file. 537 | Callback is a function with this signature: 538 | (callback ) 539 | 540 | How this function works: 541 | 1. Ask the user for the URL suggesting the URL extracted from the clipboard. 542 | 2. Ask the user for the file name to be downloaded suggesting the filename extracted from 543 | the URL. 544 | 3. Calls the callback function passing the current page name and the file name. 545 | 546 | If the URL is: http://www.myurl.com/Manual1.pdf, the current page is Unix and 547 | the callback function is: 548 | 549 | (lambda (p f) (insert (format \"%s/%s\" p f))) 550 | 551 | if the user doesn't change the suggested file name It will insert at current 552 | point: 'Unix/Manual.pdf'." 553 | (let* 554 | ((pagename (file-name-base (buffer-file-name))) 555 | 556 | ;; Get the URL suggestion from clibpoard 557 | (text (with-temp-buffer 558 | (clipboard-yank) 559 | (buffer-substring-no-properties (point-min) 560 | (point-max)))) 561 | (url (read-string "Url: " text)) 562 | (default-directory (org-wiki--assets-get-dir pagename)) 563 | 564 | (output-file (read-string "File name: " 565 | (car (last (split-string url "/")))))) 566 | 567 | (org-wiki--assets-make-dir pagename) 568 | (url-copy-file url output-file) 569 | (funcall callback pagename output-file))) 570 | 571 | 572 | ;;************** U S E R - M-X - C O M M A N D S ********************* ;;; 573 | ;; 574 | ;; @SECTION: User commands 575 | 576 | (defun org-wiki-help () 577 | "Show org-wiki commands." 578 | (interactive) 579 | (command-apropos "org-wiki-")) 580 | 581 | (defun org-wiki-switch-root () 582 | "Switch org-wiki root directory" 583 | (interactive) 584 | (helm :sources 585 | `((name . "Org-wiki root dir") 586 | (candidates . ,(mapcar (lambda (p) 587 | (cons (format "%s - %s" (file-name-nondirectory p) p) p)) 588 | (mapcar #'string-trim org-wiki-location-list))) 589 | (action . (lambda (p) 590 | ;; If custom variable is set to true, then close all org-wiki pages of current 591 | ;; org-wiki root directory 592 | (if org-wiki-close-root-switch (org-wiki-close)) 593 | ;; set new org-wiki location 594 | (setq org-wiki-location p) 595 | ;; Go to index page 596 | (org-wiki-index) 597 | ;; Inform user about new directory 598 | (message (format "Org-wiki root dir set to: %s" p)) 599 | ))))) 600 | 601 | (defun org-wiki-index () 602 | "Open the index page: /index.org. 603 | 604 | The file index.org is created if it doesn't exist." 605 | (interactive) 606 | (org-wiki--open-page org-wiki-index-file-basename)) 607 | 608 | 609 | (defun org-wiki-index-html () 610 | "Open the Wiki (Index) in the default web browser." 611 | (interactive) 612 | (browse-url (concat "file://" 613 | (org-wiki--page->html-file 614 | org-wiki-index-file-basename)))) 615 | 616 | (defun org-wiki-index-frame () 617 | "Open the index page in a new frame." 618 | (interactive) 619 | (with-selected-frame (make-frame) 620 | (org-wiki-index))) 621 | 622 | (defun org-wiki-dired-all () 623 | "Open the wiki directory in ‘dired-mode’ showing all files." 624 | (interactive) 625 | (dired org-wiki-location) 626 | (dired-hide-details-mode)) 627 | 628 | (defun org-wiki-dired () 629 | "Open the wiki directory showing only the wiki pages." 630 | (interactive) 631 | (dired (org-wiki--concat-path org-wiki-location "*.org")) 632 | (dired-hide-details-mode)) 633 | 634 | (defun org-wiki-asset-dired () 635 | "Open the asset directory of current wiki page." 636 | (interactive) 637 | (let ((pagename (file-name-base (buffer-file-name)))) 638 | (org-wiki--assets-make-dir pagename) 639 | (dired (org-wiki--assets-get-dir pagename)))) 640 | 641 | (defun org-wiki-asset-insert () 642 | "Insert link wiki-asset-sys:; to an asset file of current page.. 643 | It inserts a link of type wiki-asset-sys:; 644 | Example: [[wiki-asset-sys:Linux;LinuxManual.pdf]]" 645 | (interactive) 646 | (org-wiki--asset-helm-selection 647 | (lambda (file) 648 | (insert (format "[[wiki-asset-sys:%s;%s][%s]]" 649 | (file-name-base (org-wiki--current-page-asset-dir)) 650 | (file-name-nondirectory file) 651 | (read-string "Description: " (file-name-nondirectory file)) 652 | ))))) 653 | 654 | (defun org-wiki-asset-insert-file () 655 | "Insert link file:/ to asset file of current page at point. 656 | Use this command to insert link to files that can be opened with 657 | Emacs like source codes. It will insert a link like this 658 | - [[file:Python/GpsScript.py][GpsScript.py]]." 659 | (interactive) 660 | (org-wiki--asset-helm-selection 661 | (lambda (file) 662 | (save-excursion 663 | (insert (org-make-link-string 664 | (concat "file:" file) 665 | (file-name-nondirectory file) 666 | )))))) 667 | 668 | 669 | (defun org-wiki-asset-insert-image () 670 | "Insert link file:/ to images asset file at point. 671 | This command is similar to org-wiki-asset-insert-file but it inserts a link 672 | in this way: [[file:Linux/logo.png][file:Linux/logo.png/]]." 673 | (interactive) 674 | (org-wiki--asset-helm-selection 675 | (lambda (file) 676 | (save-excursion 677 | (insert (org-make-link-string 678 | (concat "file:" file) 679 | (concat "file:" file) 680 | )))))) 681 | 682 | 683 | 684 | (defun org-wiki-asset-insert-block () 685 | "Insert code block with contents of some asset file." 686 | (interactive) 687 | (org-wiki--asset-helm-selection 688 | (lambda (file) 689 | (save-excursion 690 | (insert (concat " - File: " (org-make-link-string (concat "file:" file)))) 691 | (insert "\n\n") 692 | (insert "#+BEGIN_SRC text\n") 693 | (insert " ") 694 | (insert (replace-regexp-in-string 695 | "\n" 696 | "\n " 697 | (with-temp-buffer 698 | (insert-file-contents file) 699 | (buffer-substring-no-properties (point-min) (point-max))))) 700 | (insert "\n#+END_SRC") 701 | )))) 702 | 703 | 704 | (defun org-wiki-asset-find-file () 705 | "Open a menu to select an asset file of current page and open it with Emacs. 706 | Note: see 'org-wiki-asset-find-sys' 707 | 708 | Example: If the current page is 'Smalltalk programming' and the user select the 709 | file 'extendingClasses-number1.gst' it will open the file below with Emacs. 710 | 711 | - Smalltalk programming/'extendingClasses-number1.gst" 712 | (interactive) 713 | (org-wiki--asset-helm-selection #'find-file)) 714 | 715 | (defun org-wiki-asset-find-sys () 716 | "Open a menu to select an asset file of current page and open it with system's app. 717 | Example: If the current page is 'Smalltalk programming' and the 718 | user select the file 'numerical-methods-in-smalltalk.pdf' it will 719 | be opened with the default system's application like Foxit PDF or 720 | Okular reader." 721 | (interactive) 722 | (org-wiki--asset-helm-selection #'org-wiki-xdg-open)) 723 | 724 | (defun org-wiki-asset-create () 725 | "Prompts the user for a file name that doesn't exist yet and insert it at point. 726 | Unlike the commands `org-wiki-asset-insert` or ` org-wiki-asset-insert-file` this command 727 | asks the user for a file that doesn't exist yet and inserts a hyperlink to it at point. 728 | 729 | It is useful to add links to scripts that will be stored in the 730 | page directory. 731 | 732 | Example: If the user enter this command and is in the page Linux 733 | and enters scriptDemoQT.py it will insert a link at point like 734 | this file:Linux/scriptDemoQT.py . 735 | 736 | - Page: /Linux.org 737 | - Directory: /Linux/" 738 | (interactive) 739 | (let ((filename (read-string "File: "))) 740 | (save-excursion 741 | (insert (org-make-link-string 742 | (concat "file:" 743 | (org-wiki--current-page-asset-file filename)) 744 | filename 745 | ))))) 746 | 747 | 748 | (defun org-wiki-asset-download-insert1 () 749 | "Download a file from a URL in the clibpoard and inserts a link wiki-asset-sys:. 750 | Note: This function is synchronous and blocks Emacs. If Emacs is stuck 751 | type C-g to cancel the download." 752 | (interactive) 753 | (org-wiki--asset-download-hof 754 | (lambda (pagename output-file) 755 | (save-excursion (insert (format "[[wiki-asset-sys:%s;%s][%s]]" 756 | pagename output-file output-file)))))) 757 | 758 | (defun org-wiki-asset-download-insert2 () 759 | "Download a file from a URL in the clibpoard and inserts a link file:/. 760 | Note: This function is synchronous and blocks Emacs. If Emacs gets frozen type C-g 761 | to cancel the download." 762 | (interactive) 763 | (org-wiki--asset-download-hof 764 | (lambda (pagename output-file) 765 | (save-excursion (insert (format "file:%s/%s" pagename output-file )))))) 766 | 767 | (defun org-wiki-helm () 768 | "Browser the wiki files using helm." 769 | (interactive) 770 | (org-wiki--helm-selection #'org-wiki--open-page)) 771 | 772 | 773 | (defun org-wiki-helm-read-only () 774 | "Open wiki page in read-only mode." 775 | (interactive) 776 | (org-wiki--helm-selection (lambda (pagename) 777 | (find-file-read-only 778 | (org-wiki--page->file pagename) 779 | )))) 780 | 781 | (defun org-wiki-helm-frame () 782 | "Browser the wiki files using helm and opens it in a new frame." 783 | (interactive) 784 | (org-wiki--helm-selection (lambda (act) 785 | (with-selected-frame (make-frame) 786 | (set-frame-name (concat "Org-wiki: " act)) 787 | (org-wiki--open-page act) 788 | )))) 789 | 790 | 791 | (defun org-wiki-switch () 792 | "Switch between org-wiki page buffers." 793 | (interactive) 794 | (helm :sources `(( 795 | (name . "Wiki Pages") 796 | (candidates . ,(mapcar (lambda (b) 797 | (cons (org-wiki--file->page (buffer-file-name b)) 798 | b 799 | )) 800 | (org-wiki--get-buffers))) 801 | (action . switch-to-buffer) 802 | )))) 803 | 804 | ;; @TODO: Implement org-wiki/helm-html 805 | ;; 806 | (defun org-wiki-helm-html () 807 | "Browser the wiki files using helm." 808 | (interactive) 809 | (helm :sources `(( 810 | (name . "Wiki Pages") 811 | 812 | (candidates . ,(delete-dups (org-wiki--page-list))) 813 | 814 | (action . org-wiki--open-page) 815 | )))) 816 | 817 | (defun org-wiki-close () 818 | "Close all opened wiki pages buffer and save them." 819 | (interactive) 820 | (mapc (lambda (b) 821 | (with-current-buffer b 822 | (when (org-wiki--is-buffer-in b) 823 | ;; save the buffer if it is bound to a file 824 | ;; and it is not read-only 825 | (when (and (buffer-file-name b) 826 | (not buffer-read-only)) 827 | (save-buffer)) 828 | (kill-this-buffer)))) 829 | (buffer-list)) 830 | (message "All wiki files closed. Ok.")) 831 | 832 | 833 | (defun org-wiki-close-image () 834 | "Close all image/picture buffers which files are in org-wiki directory." 835 | (interactive) 836 | (mapc (lambda (b) 837 | (with-current-buffer b 838 | (when (and (org-wiki--is-buffer-in b) 839 | (equal major-mode 'image-mode)) 840 | (kill-this-buffer)))) 841 | (buffer-list)) 842 | (message "All wiki images closed. Ok.")) 843 | 844 | (defun org-wiki-insert-link () 845 | "Insert a Wiki link at point for a existing page." 846 | (interactive) 847 | (org-wiki--helm-selection 848 | (lambda (page) (insert (org-wiki--make-link page))))) 849 | 850 | (defun org-wiki-insert-new () 851 | "Create a new org-wiki and insert a link to it at point." 852 | (interactive) 853 | (let ((page-name (read-string "Page: "))) 854 | (save-excursion (insert (org-make-link-string (concat "wiki:" page-name) 855 | page-name 856 | ))))) 857 | 858 | (defun org-wiki-new () 859 | "Create a new wiki page and open it without inserting a link." 860 | (interactive) 861 | (org-wiki--open-page (read-string "Page Name: "))) 862 | 863 | (defun org-wiki-html-page () 864 | "Open the current wiki page in the browser. It is created if it doesn't exist yet." 865 | (interactive) 866 | (let ((html-file (org-wiki--replace-extension (buffer-file-name) "html"))) 867 | (if (not (file-exists-p html-file)) 868 | (org-html-export-to-html)) 869 | (browse-url html-file))) 870 | 871 | (defun org-wiki-html-page2 () 872 | "Exports the current wiki page to html and opens it in the browser." 873 | (interactive) 874 | (org-html-export-to-html) 875 | (browse-url (org-wiki--replace-extension (buffer-file-name) "html"))) 876 | 877 | (defun org-wiki-search () 878 | "Search all wiki pages that contains a pattern (regexp or name)." 879 | (interactive) 880 | (rgrep (read-string "org-wiki - Search for: ") 881 | "*.org" 882 | org-wiki-location 883 | nil)) 884 | 885 | (defun org-wiki-open () 886 | "Opens the wiki repository with system's default file manager." 887 | (interactive) 888 | (org-wiki-xdg-open org-wiki-location)) 889 | 890 | (defun org-wiki-asset-open () 891 | "Open asset directory of current page with system's default file manager." 892 | (interactive) 893 | (org-wiki--assets-buffer-make-dir) 894 | (org-wiki-xdg-open (file-name-base (buffer-file-name)))) 895 | 896 | (defun org-wiki-assets-helm () 897 | "Open the assets directory of a wiki page." 898 | (interactive) 899 | (org-wiki--helm-selection 900 | (lambda (page) 901 | (org-wiki--assets-make-dir page) 902 | (dired (org-wiki--assets-get-dir page))))) 903 | 904 | 905 | (defun org-wiki-make-org-publish-plist (org-exporter) 906 | "Prepare plist for use with `org-publish'." 907 | (let ((plist-base 908 | `("html" 909 | :base-directory ,org-wiki-location 910 | :base-extension "org" 911 | :publishing-directory ,org-wiki-location 912 | :publishing-function ,org-exporter))) 913 | (setcdr plist-base 914 | (org-combine-plists (cdr plist-base) org-wiki-publish-plist)) 915 | plist-base)) 916 | 917 | (defun org-wiki-export-with (org-exporter) 918 | "Export all pages to a given format. See full doc. 919 | ORG-EXPORTER is a function that exports an org-mode page to a specific format like html. 920 | It can be for instance: 921 | 922 | - org-html-publish-to-thml 923 | - org-latex-publish-to-pdf 924 | - org-latex-publish-to-latex 925 | 926 | WARN: This is a synchronous function and can freeze Emacs. Emacs will freeze while 927 | the exporting doesn't finish. Type C-g to abort the execution." 928 | (interactive) 929 | (let ((org-html-htmlize-output-type 'css) 930 | (org-html-htmlize-font-prefix "org-") 931 | (pub-plist (org-wiki-make-org-publish-plist org-exporter)) 932 | ) 933 | (org-publish pub-plist t))) 934 | 935 | 936 | (defun org-wiki-export-html-sync () 937 | "Export all pages to html in synchronous mode." 938 | (interactive) 939 | (let ((org-html-htmlize-output-type 'css) 940 | (org-html-htmlize-font-prefix "org-") 941 | (pub-plist (org-wiki-make-org-publish-plist 'org-html-publish-to-html)) 942 | ) 943 | (org-publish pub-plist t))) 944 | 945 | (defun org-wiki-export-html () 946 | "Export all pages to html. 947 | Note: This function doesn't freeze Emacs since it starts another Emacs process." 948 | (interactive) 949 | (compile (mapconcat 'identity 950 | `(,org-wiki-emacs-path 951 | "--batch" 952 | "-l" ,org-wiki-user-init-file 953 | "-f" "org-wiki-export-html-sync" 954 | "--kill" 955 | ) 956 | " " 957 | ))) 958 | 959 | (defun org-wiki-make-menu () 960 | "Optional command to build an utility menu." 961 | (interactive) 962 | (easy-menu-define org-wik-menu global-map "Org-wiki" 963 | 964 | `("org-wiki" 965 | ("Main" 966 | ["Go to Index page \nM-x org-wiki-index" (org-wiki-index)] 967 | 968 | ["---" nil] 969 | ["Browsing" nil] 970 | ["Browse page \nM-x org-wiki-helm" (org-wiki-helm)] 971 | ["Browse page in other frame \nM-x org-wiki-helm-frame" (org-wiki-helm-frame)] 972 | ["Browse pages in read-only mode \nM-x org-wiki-helm-read-only" (org-wiki-helm-read-only)] 973 | ["---" nil] 974 | ["Wiki Directory" nil] 975 | ["Open org-wiki directory \nM-x org-wiki-dired" (org-wiki-dired)] 976 | ["Open org-wiki directory with system's file manager.\nM-x org-wiki-open" (org-wiki-open)] 977 | ["Close all pages \nM-x org-wiki-close" (org-wiki-close)] 978 | 979 | ["---" nil] 980 | ["Html export" nil] 981 | ["Open index page (html) in the browser \nM-x org-wiki-index-html" (org-wiki-index-html)] 982 | ["Export all pages to html \nM-x org-wiki-export-html" (org-wiki-export-html)] 983 | ["Help - Show all org-wiki commands \nM-x org-wiki-help" (org-wiki-help)] 984 | ) 985 | ["---" nil] 986 | ("Page Commands" 987 | ["Browse current page asset directory.\nM-x org-wiki-asset-dired" 988 | (org-wiki-asset-dired)] 989 | ["Browse current page asset directory with system's file manager.\nM-x org-wiki-asset-open" 990 | (org-wiki-asset-open)] 991 | 992 | ["Insert a link to a wiki page \nM-x org-wiki-insert" (org-wiki-insert)] 993 | ["Insert a link of type wiki-asset-sys at point.\nM-x org-wiki-asset-insert" 994 | (org-wiki-asset-insert)] 995 | ["Insert a link of type file:/ at point.\nM-x org-wiki-asset-insert-file" 996 | (org-wiki-asset-insert-file) 997 | ] 998 | ["Download an asset file and insert a wiki-asset-sys link at point.\nM-x org-wiki-asset-download-insert1" 999 | (org-wiki-asset-download-insert1) 1000 | ] 1001 | 1002 | ["Download an asset file and insert a link at point of type file:/.\nM-x org-wiki-asset-download-insert2" 1003 | (org-wiki-asset-download-insert2)] 1004 | 1005 | ) 1006 | ["---" nil] 1007 | ("Org-mode" 1008 | ["Filter headings \nM-x helm-org-in-buffer-headings" (helm-org-in-buffer-headings)] 1009 | ["Hem occur \nM-x helm-occur" (helm-occur)] 1010 | ["Toggle Read only \nM-x read-only-mode" (read-only-mode 'toggle)] 1011 | ["Toggle Images \nM-x org-toggle-inline-images" (org-toggle-inline-images)] 1012 | ["Toggle Link display \nM-x org-toggle-link-display" (org-toggle-link-display)] 1013 | )))) 1014 | 1015 | 1016 | ;; 1017 | ;; Despite this function was implemented as a interface to 1018 | ;; Python3 simple http server, it can be refactored to work 1019 | ;; with another more powerful http server such as Nginx. 1020 | ;; 1021 | (defun org-wiki-server-toggle () 1022 | "Start/stop org-wiki http server. It requires Python3. 1023 | Note: This command requires Python3 installed." 1024 | (interactive) 1025 | (let ( 1026 | ;; Process name 1027 | (pname "org-wiki-server") 1028 | ;; Buffer name - Display process output (stdout) 1029 | (bname "*org-wiki-server*") 1030 | ;; Set current directory to org-wiki repository. 1031 | (default-directory org-wiki-location)) 1032 | (if (not (get-buffer bname)) 1033 | (progn 1034 | (sit-for 0.1) 1035 | (switch-to-buffer bname) 1036 | (save-excursion ;; Save cursor position 1037 | (insert "Server started ...\n\n") 1038 | (message "\nServer started ...\n") 1039 | 1040 | ;; Show machine network cards' IP addresses. 1041 | (cl-case system-type 1042 | ;;; Linux 1043 | (gnu/linux (insert (shell-command-to-string "ifconfig"))) 1044 | ;;; Free BSD OS 1045 | (gnu/kfreebsd (insert (shell-command-to-string "ifconfig"))) 1046 | ;; Mac OSX - (Not tested ) 1047 | (darwin (insert (shell-command-to-string "ifconfig"))) 1048 | ;; Windows 7, 8, 10 - Kernel NT 1049 | (windows-nt (insert (shell-command-to-string "ipconfig"))))) 1050 | (start-process pname 1051 | bname 1052 | "python3" 1053 | "-m" 1054 | "http.server" 1055 | "--bind" 1056 | org-wiki-server-host 1057 | org-wiki-server-port) 1058 | (when (y-or-n-p "Open server in browser ?") 1059 | (browse-url (format "http://localhost:%s" org-wiki-server-port)))) 1060 | (progn (switch-to-buffer bname) 1061 | (kill-process (get-process pname)) 1062 | (message "Server stopped.") 1063 | )))) 1064 | 1065 | (defun org-wiki-paste-image () 1066 | "Paste a image asking the user for the file name." 1067 | (interactive) 1068 | (let* ((dir (file-name-as-directory 1069 | (file-name-base 1070 | (buffer-file-name)))) 1071 | (image-name (read-string "Image name: " ))) 1072 | (org-wiki--assets-make-dir dir) 1073 | (insert "#+CAPTION: ") 1074 | (save-excursion 1075 | (insert image-name) 1076 | (insert "\n") 1077 | (insert 1078 | (org-make-link-string 1079 | (concat "file:" 1080 | (string-trim 1081 | (shell-command-to-string 1082 | (mapconcat #'identity 1083 | `("java" 1084 | "-jar" 1085 | ;;,(expand-file-name "~/bin/Clip.jar") 1086 | ,(expand-file-name org-wiki-clip-jar-path) 1087 | "--name" 1088 | ,(concat "\"" image-name "\"") 1089 | ,(concat "\"" dir "\"") 1090 | ) 1091 | " " 1092 | ))))))))) 1093 | 1094 | (defun org-wiki-paste-image-uuid () 1095 | "Paste a image with automatic generated name (uuid)." 1096 | (interactive) 1097 | (let* ((dir (file-name-base 1098 | (buffer-file-name)))) 1099 | 1100 | (org-wiki--assets-make-dir dir) 1101 | 1102 | (insert "#+CAPTION: ") 1103 | (save-excursion 1104 | (insert "\n") 1105 | (insert 1106 | (org-make-link-string 1107 | (concat "file:" 1108 | (string-trim 1109 | (shell-command-to-string 1110 | (mapconcat #'identity 1111 | `("java" 1112 | "-jar" 1113 | ;;,(expand-file-name "~/bin/Clip.jar") 1114 | ,(expand-file-name org-wiki-clip-jar-path) 1115 | "--uuid" 1116 | ,(concat "\"" dir "\"")) 1117 | 1118 | " " 1119 | ))))))))) 1120 | 1121 | 1122 | ;; Custom Minor Mode 1123 | (define-minor-mode org-wiki-panel-minor-mode 1124 | "Ishell multi line mode" 1125 | ;; The initial value - Set to 1 to enable by default 1126 | nil 1127 | ;; The indicator for the mode line. 1128 | nil 1129 | ;; The minor mode keymap 1130 | `( 1131 | ;; Commands to Open Index page: 1132 | (,(kbd "bii") . org-wiki-index) 1133 | (,(kbd "bfi") . org-wiki-index-frame) 1134 | (,(kbd "bbi") . org-wiki-index-html) 1135 | 1136 | ;; ==== Commands to browse pages ========== 1137 | (,(kbd "hh") . org-wiki-helm ) 1138 | (,(kbd "hj") . org-wiki-switch ) 1139 | (,(kbd "hr") . org-wiki-helm-read-only) 1140 | (,(kbd "hf") . org-wiki-helm-frame) 1141 | (,(kbd "kk") . org-wiki-close) 1142 | 1143 | ;; ==== Commands to browse directories ===== 1144 | (,(kbd "dw") . org-wiki-dired ) 1145 | (,(kbd "do") . org-wiki-open) 1146 | 1147 | ;; ==== Install Menu ======================= 1148 | (,(kbd "smm") . org-wiki-make-menu) 1149 | (,(kbd "see") . org-wiki-export-html) 1150 | (,(kbd "sec") . (lambda () (interactive) (customize-group "org-wiki"))) 1151 | (,(kbd "seg") . (lambda () (interactive) (browse-url "http://www.github.com/caiorss/org-wiki"))) 1152 | 1153 | ;; === Toggle commands ===================== 1154 | (,(kbd "tts") . org-wiki-server-toggle) 1155 | ;; (,(kbd "ttl") . org-toggle-link-display) 1156 | ;; (,(kbd "tti") . org-toggle-inline-images) 1157 | 1158 | (,(kbd "tty") . (lambda () (interactive) 1159 | (tool-bar-mode 'toggle) 1160 | (menu-bar-mode 'toggle) 1161 | )) 1162 | 1163 | (,(kbd "ttb") . (lambda () (interactive) (tool-bar-mode 'toggle))) 1164 | (,(kbd "ttm") . (lambda () (interactive) (menu-bar-mode 'toggle))) 1165 | 1166 | (,(kbd "q") . (lambda () (interactive) (kill-buffer))) 1167 | ) 1168 | ;; Make mode local to buffer rather than global 1169 | ;; :global t 1170 | ) 1171 | 1172 | 1173 | 1174 | (defun org-wiki-rgrep (pattern) 1175 | "Search org-wiki with a regex pattern." 1176 | (interactive "sSearch: ") 1177 | (rgrep pattern "*.org" org-wiki-location nil)) 1178 | 1179 | (defun org-wiki-keywords () 1180 | "Display all org-wiki files with '#+KEYWORDS:' field." 1181 | (interactive) 1182 | (org-wiki-rgrep "^#+KEYWORDS:")) 1183 | 1184 | (defun org-wiki-desc () 1185 | "Search all org-wiki files with '#+DESCRIPTION:' field." 1186 | (interactive) 1187 | (org-wiki-rgrep "^#+DESCRIPTION:")) 1188 | 1189 | (defun org-wiki-find-dired () 1190 | "Show all org-wiki files in all subdirectories of org-wiki-location." 1191 | (interactive) 1192 | (find-dired org-wiki-location 1193 | (mapconcat #'identity 1194 | '( 1195 | "-not -path '*/.git*'" ;; Exclude .git Directory 1196 | "-and -not -name '.#*'" ;; Exclude temporary files starting with # 1197 | "-and -not -name '#*'" 1198 | "-and -not -name '*#'" 1199 | "-and -not -name '*~' " ;; Exclude ending with ~ (tilde) 1200 | "-and -not -name '*.html' " ;; Exclude html files 1201 | ) 1202 | 1203 | " " 1204 | ))) 1205 | 1206 | (defun org-wiki-website () 1207 | "Open org-wiki github repository." 1208 | (interactive) 1209 | (browse-url "http://www.github.com/caiorss/org-wiki")) 1210 | 1211 | (defun org-wiki-header () 1212 | "Insert a header at the top of the file." 1213 | (interactive) 1214 | ;; Save current cursor location and restore it 1215 | ;; after completion of block insider save-excursion. 1216 | (save-excursion 1217 | (let* 1218 | ;; replace '%n' by page title 1219 | ((text1 (replace-regexp-in-string 1220 | "%n" 1221 | (file-name-base (buffer-file-name)) 1222 | org-wiki-template)) 1223 | ;; Replace %d by current date in the format %Y-%m-%d 1224 | (text2 (replace-regexp-in-string 1225 | "%d" 1226 | (format-time-string "%Y-%m-%d") 1227 | text1 1228 | ))) 1229 | ;; Got to top of file 1230 | (goto-char (point-min)) 1231 | (insert text2)))) 1232 | 1233 | (defun org-wiki-panel () 1234 | "Create a command panel for org-wiki." 1235 | (interactive) 1236 | (let ((buf (get-buffer-create "*org-wiki-panel*"))) 1237 | (switch-to-buffer buf) 1238 | (kill-region (point-min) (point-max)) 1239 | (org-wiki-panel-minor-mode) 1240 | (insert 1241 | " Org-wiki command panel 1242 | Open Index Page 1243 | 1244 | [bii] - Go to index. - M-x org-wiki-index 1245 | [bfi] - Go to index in a new frame. - M-x org-wiki-index-frame 1246 | [bbi] - Open index page in browser - M-x org-wiki-index-html 1247 | 1248 | Browse Pages 1249 | 1250 | [kk] - Close all wiki buffers - M-x org-wiki-close 1251 | [hh] - Open a page. - M-x org-wiki-helm 1252 | [hj] - Switch between org-wiki buffers - M-x org-wiki-switch 1253 | [hr] - Open a page in read-only mode. - M-x org-wiki-helm-read-only 1254 | [hf] - Open a page in a new frame. - M-x org-wiki-helm-frame 1255 | 1256 | 1257 | Open Directory 1258 | 1259 | [dw] - Open wiki directory in dired buffer - M-x org-wiki-index 1260 | [do] - Open wiki directory in file manager - M-x org-wiki-open 1261 | 1262 | Special Commands 1263 | 1264 | [q ] - Quit. 1265 | [sec] - Customize org-wiki - M-x customize-group org-wiki 1266 | [see] - Export to all pages to html - M-x org-wiki-export-html 1267 | [smm] - Install org-wiki menu. - M-x org-wiki-make-menu 1268 | [seg] - Go to org-wiki web site 1269 | 1270 | Toggle 1271 | 1272 | [tts] - Toggle org-wiki-server - M-x org-wiki-server-toggle 1273 | 1274 | [tty] - Toggle Emacs toolbar and menu 1275 | [ttb] - Toggle Emacs toolbar 1276 | [ttm] - Toggle Emacs menu bar 1277 | " 1278 | )) 1279 | (read-only-mode)) 1280 | 1281 | ;; =========== Copy Path Commands ============= ;; 1282 | 1283 | 1284 | (defun org-wiki-copy-location () 1285 | "Copy org-wiki location path to clipboard." 1286 | (interactive) 1287 | (let ((msg (expand-file-name org-wiki-location))) 1288 | (with-temp-buffer 1289 | (insert msg) 1290 | (message (format "Copied to clipboard: %s" msg)) 1291 | (clipboard-kill-region (point-min) (point-max))))) 1292 | 1293 | 1294 | (defun org-wiki-copy-index-html () 1295 | "Copy org-wiki html index page to clipboard." 1296 | (interactive) 1297 | (let ((msg (expand-file-name (concat (file-name-as-directory org-wiki-location) 1298 | "index.html" )))) 1299 | (with-temp-buffer 1300 | (insert msg) 1301 | (message (format "Copied to clipboard: %s" msg)) 1302 | (clipboard-kill-region (point-min) (point-max))))) 1303 | 1304 | 1305 | (defun org-wiki-copy-asset-path () 1306 | "Copy current page's asset directory to clipboard." 1307 | (interactive) 1308 | (let ((msg (expand-file-name (concat (file-name-as-directory org-wiki-location) 1309 | (file-name-base (buffer-file-name)))))) 1310 | (with-temp-buffer 1311 | (insert msg) 1312 | (message (format "Copied to clipboard: %s" msg)) 1313 | (clipboard-kill-region (point-min) (point-max))))) 1314 | 1315 | 1316 | ;; ============ Backup Commands =============== ;; 1317 | 1318 | 1319 | (defun org-wiki-backup-make () 1320 | "Make a org-wiki backup." 1321 | (interactive) 1322 | (let* ((zipfile (concat "org-wiki-" (format-time-string "%Y-%m-%d") ".zip")) 1323 | (destfile (concat (file-name-directory org-wiki-backup-location) zipfile)) 1324 | (default-directory org-wiki-location)) 1325 | (switch-to-buffer "*org-wiki-backup*") 1326 | 1327 | ;; Crate org-wiki backup location directory if doesn't exist. 1328 | (if (not (file-exists-p org-wiki-backup-location)) 1329 | (make-directory org-wiki-backup-location t)) 1330 | 1331 | (if (file-exists-p destfile) (delete-file destfile)) 1332 | (if (file-exists-p zipfile) (delete-file zipfile)) 1333 | 1334 | ;; Clear buffer removing all lines 1335 | (delete-region (point-min) (point-max)) 1336 | (set-process-sentinel 1337 | (start-process 1338 | "org-wiki-backup" ;; Process name 1339 | "*org-wiki-backup*" ;; Buffer where output is displayed. 1340 | ;; Shell command 1341 | "zip" "-r" "-9" zipfile ".") 1342 | (lexical-let ((zipfile zipfile) 1343 | (destfile destfile)) 1344 | (lambda (process state) 1345 | (when (equal (process-exit-status process) 0) 1346 | (switch-to-buffer "*org-wiki-backup*") 1347 | (rename-file zipfile org-wiki-backup-location t) 1348 | (message "Backup done. Ok.") 1349 | (insert "\nBackup done. Ok. Run M-x org-wiki-backup-dir to open backup directory.") 1350 | )))))) 1351 | 1352 | (defun org-wiki-backup-dir () 1353 | "Open org-wiki backup directory in dired mode." 1354 | (interactive) 1355 | ;; Create org-wiki backup location directory if doesn't exist. 1356 | (if (not (file-exists-p org-wiki-backup-location)) 1357 | (make-directory org-wiki-backup-location t)) 1358 | ;; Open backup location 1359 | (dired org-wiki-backup-location) 1360 | ;; Update buffer 1361 | (revert-buffer)) 1362 | 1363 | ;; ============ Command Alias ================= ;; 1364 | 1365 | 1366 | (defun org-wiki-nav () 1367 | "Navigate through org-mode headings. Alias to helm-org-in-buffer-headings." 1368 | (interactive) 1369 | (helm-org-in-buffer-headings)) 1370 | 1371 | (defun org-wiki-occur () 1372 | "Search current buffer with helm-occur. Alias to helm-occur." 1373 | (interactive) 1374 | (helm-occur)) 1375 | 1376 | (defun org-wiki-toggle-images () 1377 | "Toggle inline images. Alias to M-x org-toggle-inline-images." 1378 | (interactive) 1379 | (org-toggle-inline-images)) 1380 | 1381 | (defun org-wiki-toggle-link () 1382 | "Toggle link display. Alias to M-x org-toggle-link-display" 1383 | (interactive) 1384 | (org-toggle-link-display)) 1385 | 1386 | (defun org-wiki-latex () 1387 | "Display latex formulas. Alias to M-x org-preview-latex-fragment" 1388 | (interactive) 1389 | (org-preview-latex-fragment)) 1390 | 1391 | 1392 | (defun org-wiki-insert-latex () 1393 | "Insert a latex template at point" 1394 | (interactive) 1395 | (helm :sources 1396 | `((name . "Latex Templates") 1397 | (candidates . ,(mapcar 1398 | (lambda (p) 1399 | (cons (concat (car p) " = " (cdr p)) 1400 | (cdr p))) 1401 | org-wiki-latex-templates 1402 | )) 1403 | (action . insert)))) 1404 | 1405 | (defun org-wiki-insert-symbol () 1406 | "Insert symbols from math, physics, Greek letters and others." 1407 | (interactive) 1408 | (helm :sources 1409 | `((name . "General math and misc symbols") 1410 | (candidates . ,(mapcar 1411 | (lambda (p) 1412 | (cons (concat (car p) " = " (cdr p)) 1413 | (cdr p))) 1414 | org-wiki-symbol-list 1415 | )) 1416 | (action . insert)))) 1417 | 1418 | (defun org-wiki-insert-block () 1419 | "Insert org-mode blocks such as Latex equation, code block, quotes, tables and etc." 1420 | (interactive) 1421 | (helm :sources 1422 | `((name . "Org-mode code block") 1423 | (candidates . ,org-wiki-template-blocks) 1424 | (action . insert)))) 1425 | 1426 | 1427 | ;; ========= org-wiki Internal databases =========== ;; 1428 | 1429 | ;; Variable containing useful math, physics, currencies and greek letters used by function 1430 | ;; org-wiki-insert-symbol 1431 | (defvar org-wiki-symbol-list 1432 | '( 1433 | ("alpha" . "α") 1434 | ("beta" . "β") 1435 | ("gamma" ."γ") 1436 | ("Gamma" ."Γ") 1437 | ("delta" . "δ") 1438 | ("Delta" . "Δ") 1439 | ("episilon" ."ε") 1440 | ("zeta" ."ζ") 1441 | ("eta" ."η") 1442 | ("theta" ."θ") 1443 | ("Theta" ."Θ") 1444 | ("iota" ."ι") 1445 | ("kappa" ."κ") 1446 | ("lambda" ."λ") 1447 | ("mu" ."μ") 1448 | ("nu" ."ν") 1449 | ("pi" ."π") 1450 | ("Pi" ."Π") 1451 | ("rho" ."") 1452 | ("sigma" ."σ") 1453 | ("Sigma" ."Σ") 1454 | ("tau" ."τ") 1455 | ("upsilon" ."υ") 1456 | ("phi" ."φ") 1457 | ("Phi" ."Φ") 1458 | ("psi" ."Ψ") 1459 | ("omega" ."ω") 1460 | ("Omega" ."Ω") 1461 | 1462 | ("Multiplication sign" . "×") 1463 | ("Multiplication dot (sdot)" . "⋅") 1464 | ("Division sign" . "÷") 1465 | 1466 | ;;; Mathematical Symbols for calculus 1467 | ("Square root sqrt" . "√") 1468 | ("Cubic root cbrt" . "∛") 1469 | ("Fourth root" . "∜") 1470 | 1471 | ("Infinity" . "∞") 1472 | ("summation" . "Σ") 1473 | ("product - big PI" . "Π") 1474 | ("nabla" . "∇") 1475 | ("integral" ."∫") 1476 | ("double integral" . "∬") 1477 | ("triple integral" . "∭") 1478 | ("minus or equal +-" . "±") 1479 | ("approximately equal ~=" . "≈") 1480 | ("Partial derivate" . "∂") 1481 | ("tensor-prod" . "⊗") 1482 | ("Direct sum or Exclusive or" . "⊕") 1483 | ("Gradient, nabla" ."∇") 1484 | 1485 | ("Laplace transform" . "ℒ") 1486 | ("Fourier transform" . "ℱ") 1487 | 1488 | ;; Symbols for set algebra 1489 | ("Empty set" . "∅") 1490 | ("Set membership" . "∈") 1491 | ("Universal quantifier" . "∀") 1492 | ("Existential quantifier" . "∃") 1493 | ("If only if, triple bar" . "≡") 1494 | 1495 | ("Logic - Logical NOT" . "¬") 1496 | ("Logic - Logical AND" . "∧") 1497 | ("Logic - Logical OR" . "∨") 1498 | 1499 | 1500 | ("Real numbers" . "ℝ") 1501 | 1502 | ;; Misc Symbols 1503 | ("Per mile" . "‰") 1504 | ("Per basis points" . "‱") 1505 | ("Degree" . "°") 1506 | ("Fahrenheit" . "℉") 1507 | ("Celsius" . "℃") 1508 | ("Angstrom" . "Å") 1509 | ("Electromotive force e.m.f" . "ℰ") 1510 | ("Sign - Sound recording symbol" . "Ⓟ") 1511 | ("Sign - Registered Copyright" . "®") 1512 | ("Sign - Copyright" . "©") 1513 | ("Left arrow" . "←") 1514 | ("Right arrow" . "→") 1515 | ("Down arrow" . "↓") 1516 | ("Up arrow" . "↑") 1517 | ("Black big star" . "★") 1518 | ("With big star" . "☆") 1519 | ("Pentagram" . "⛤") 1520 | 1521 | ;; Geometry 1522 | ("Geometry - angle" . "∠") 1523 | ("Geometry - measured angle" . "∡") 1524 | ("Geometry - Spherical angle" . "∢") 1525 | ("Geometry - Perpendicular to" . "⟂") 1526 | ("Geometry - right angle" . "∟") 1527 | 1528 | ;; Health and safety 1529 | ("WARN Skull and crossbones" . "☠") 1530 | ("WARN Radioactive" . "☢") 1531 | ("WARN Biohazard" . "☣") 1532 | ("WARN Warning sign" . "⚠") 1533 | ("WARN High voltage" . "⚡") 1534 | 1535 | ;; Fractions 1536 | ("Fraction one-quarter" . "¼") 1537 | ("Fraction one-half" . "½") 1538 | ("Fraction one-third" . "⅓") 1539 | ("Fraction two-thirds" . "⅔") 1540 | ("Fraction one-fifth" . "⅕") 1541 | ("Fraction three-quarters" . "¾") 1542 | ("Fraction one-seventh" . "⅐") 1543 | ("Fraction one-ninth" . "⅑") 1544 | 1545 | ;; Currencies 1546 | ("Currency Dollar" . "$") 1547 | ("Currency GPB Sterling pounds" . "£") 1548 | ("Currency Euro" . "€") 1549 | ("Currency Yen, Yuan, Reminbi (China)" . "¥") 1550 | ("Currency Won" . "₩") 1551 | ("Currency Russian Ruble" . "₽") 1552 | ("Currency Lira" . "₤") 1553 | ("Currency Bitcoin" . "₿") 1554 | ("Currency Indian Rupee" . "₹") 1555 | )) 1556 | 1557 | (defvar org-wiki-template-blocks 1558 | '( 1559 | ("General code block" . "#+BEGIN_SRC \n\n#+END_SRC") 1560 | ("Latex equation" . "\\begin{equation} \n\n\\end{equation}") 1561 | ("Latex equation with name" . "#+NAME: eqn:myequation \n\\begin{equation} \n2x + x^2\n\\end{equation}") 1562 | ("Table" . "| | | |\n|--|--|--|\n| | | |\n| | | | \n") 1563 | ("Quote" . "#+BEGIN_QUOTE \n\n#+END_QUOTE") 1564 | ("Verse" . "#+BEGIN_VERSE \n\n#+END_VERSE") 1565 | ("Example" . "#+BEGIN_EXAMPLE \n\n#+END_EXAMPLE") 1566 | ("HTML" . "#+BEGIN_HTML \n\n#+END_HTML") 1567 | ("Python code block" . "#+BEGIN_SRC python \n\n#+END_SRC") 1568 | ("Ruby code block" . "#+BEGIN_SRC ruby \n\n#+END_SRC") 1569 | ("JavaScript block" . "#+BEGIN_SRC js \n\n#+END_SRC") 1570 | ("R code block" . "#+BEGIN_SRC R \n\n#+END_SRC") 1571 | ("Elisp code block" . "#+BEGIN_SRC elisp \n\n#+END_SRC") 1572 | ("C++ code block" . "#+BEGIN_SRC cpp \n\n#+END_SRC") 1573 | ("Scala code block" . "#+BEGIN_SRC scala \n\n#+END_SRC") 1574 | )) 1575 | 1576 | ;; Latex templates used by user command M-x org-wiki-insert-latex 1577 | (defvar org-wiki-latex-templates 1578 | '( 1579 | ("Latex equation block " . "\\begin{equation}\n\n\\end{equation}") 1580 | ("Basic Fraction num/den - ½" . "\\frac{num}{den}") 1581 | ("Basic Summation - Σ from a to b" . "\\sum_{a}^{b}") 1582 | ("Basic Product - Π from a to b" . "\\prod_{a}^{b}") 1583 | ("Basic Binomial coefficient (n k) = n! / ((n -k)! x k!) " . "{n \\choose k}") 1584 | 1585 | ("Calculus Limit lim(x -> ∞) f(x)" . "\\lim_{x \\to \\infty} f(x)") 1586 | ("Calculus Integral - ∫ from a to b" . "\\int_{a}^{b}") 1587 | ("Calculus Infinity - ∞" . "\\infty") 1588 | ("Calculus Gradient, nabla - ∇" . "\\nabla") 1589 | ("Calculus Derivate of f df/dx" . "\\frac{df}{dx}" ) 1590 | ("Calculus Second Derivate of f d^2f/dx^2" . "\\frac{d^2f}{dx^2}" ) 1591 | ("Calculus Derivate operation d/dx p(x)" . "\\frac{d}{dx} p(x)" ) 1592 | ("Calculus Second Derivate operation d^2/dx^2 p(x)" . "\\frac{d^2}{dx^2} p(x)" ) 1593 | ("Calculus Partial derivate - ∂" . "\\partial") 1594 | ("Calculus Partial derivate fraction ∂x/∂t" . "\\frac{\\partial x}{\\partial y}") 1595 | ("Calculus Second Partial derivate fraction ∂2x/∂t2" . "\\frac{\\partial^2 x}{\\partial y^2}") 1596 | 1597 | ("Operator - Is not equal to <> or /=" . "\\neq") 1598 | ("Operator - Equivalent or if only if ≡" . "\\equiv") 1599 | ("Operator - less or equal <=" . "\\eql") 1600 | ("Operator - greater or equal >=" . "\\geq") 1601 | ("Operator - times x" . "\\times") 1602 | ("Operator - div %" . "\\div") 1603 | ("Operator - Approximately ~=" . "\\prox") 1604 | ("Operator - Proportional to ∝" . "\\propto") 1605 | 1606 | ("Escape - $" . "\\textdollar") 1607 | ("Escape - Underline - _ " . "\\_") 1608 | ("Escape - Ampersand - &" . "\\&") 1609 | ("Escape - percent - %" . "\\%") 1610 | ("Escape - tilde ~" . "\\sim") 1611 | 1612 | ("Func - limit" . "\\lim") 1613 | ("Func - √ square root sqrt" . "\\sqrt{}") 1614 | ("Func - n√ nth root" . "\\sqrt[n]{}") 1615 | 1616 | ("Enclosing () - Big parenthesis" . "\\left( \\right)") 1617 | ("Enclosing \/ - Underbrace" . "\\underbrace{ }") 1618 | ("Enclosing /\ - Overbrace" . "\\overbrace{ }") 1619 | 1620 | ("Accent - hat â, î" . "\\hat{}") 1621 | ("Accent - grave à, ì" . "\\grave{}") 1622 | ("Accent - bar - stroke over symbol" . "\\bar{}") 1623 | ("Accent - tilde - ã, ĩ - tilde over symbol" . "\\tilde{}") 1624 | ("Accent - dot (derivate) symbol" . "\\dot{}") 1625 | ("Accent - double dot (double derivate) symbol" . "\\ddot{}") 1626 | ("Accent - arrow over symbol, vector" . "\\vec{}") 1627 | 1628 | ;; Set notation 1629 | ("Sets - N Set of Natural Numbers" . "\\N") 1630 | ("Sets - Z Set of Integers" . "\\Z") 1631 | ("Sets - ℝ Real Numbers" . "\\R") 1632 | ("Sets - C Complex Numbers" . "\\C") 1633 | ("Sets - H Quaternions" . "\\H") 1634 | ("Sets - ∈ Is member of" . "\\in") 1635 | ("Sets - ∃ Exists" . "\\exists") 1636 | ("Sets - ∀ forall universal quantifier" . "\\forall") 1637 | ("Sets - ¬ Logical NOT" . "\\neg") 1638 | ("Sets - ∨ Logical OR" . "\\lor") 1639 | ("Sets - ∧ Logical OR" . "\\land") 1640 | 1641 | ;; Greek letters 1642 | ("Greek α - lower alpha" . "\\alpha") 1643 | ("Greek β - lower beta" . "\\beta") 1644 | ("Greek σ - lower sigma" . "\\sigma") 1645 | ("Greek Σ - upper sigma" . "\\Sigma") 1646 | ("Greek γ - lower gamma" . "\\gamma") 1647 | ("Greek Γ - upper gamma" . "\\Gamma") 1648 | ("Greek δ - lower delta" . "\\delta") 1649 | ("Greek Δ - upper delta" . "\\Delta") 1650 | ("Greek λ - lower lambda" . "\\lambda") 1651 | ("Greek Λ - Upper lambda" . "\\Lambda") 1652 | ("Greek ε - epsilon" . "\\vepisilon") 1653 | ("Greek ε - varepsilon" . "\\episilon") 1654 | ("Greek ζ - zeta" . "\\zeta") 1655 | ("Greek η - eta" . "\\eta") 1656 | ("Greek μ - mu" . "\\mu") 1657 | ("Greek ρ - rho" . "\\rho") 1658 | ("Greek φ - lower phi" . "\\phi") 1659 | ("Greek Φ - upper phi" . "\\Phi") 1660 | ("Greek ω - lower omega" . "\\omega") 1661 | ("Greek Ω - upper omega" . "\\Omega") 1662 | ("Greek Ψ - psi" . "\\psi") 1663 | ("Greek τ - tau" . "\\tau") 1664 | ("Greek ι - lower iota" . "\\iota") 1665 | ("Greek ξ - lower xi" . "\\xi") 1666 | ("Greek Ξ - upper xi" . "\\xi") 1667 | ("Symbol -> Right arrow" . "\\rightarrow") 1668 | ("Symbol <- Left arrow" . "\\leftarrow") 1669 | ("Symbol Up arrow" . "\\uparrow") 1670 | ("Symbol Down arrow" . "\\downarrow") 1671 | )) 1672 | 1673 | 1674 | (provide 'org-wiki) 1675 | ;;; org-wiki.el ends here 1676 | -------------------------------------------------------------------------------- /sandbox/README.org: -------------------------------------------------------------------------------- 1 | * Org-Wiki Sandbox 2 | 3 | This directory contains a script _sandbox.sh_ to test 4 | [[file:~/Documents/projects/org-wiki.emacs/org-wiki.el][file:../org-wiki.el]] in a isolate environment with a 5 | sample-org-wiki which the user can experiment. 6 | 7 | Directory layout: 8 | 9 | - ./sandbox 10 | - ./sandbox/sandbox.sh - Test script. 11 | - ./sandbox/init.el - Emacs init script 12 | - ./sandbox/wiki - Sample org-wiki for testing 13 | - ./sandbox/elpa - Directory which Emacs' packages will be installed. 14 | 15 | Run the test: 16 | 17 | #+BEGIN_SRC sh 18 | cd sandbox 19 | ./sandbox.sh run 20 | #+END_SRC 21 | 22 | Clean (Remove the directory elpa). 23 | 24 | #+BEGIN_SRC sh 25 | cd sandbox 26 | ./sandbox clean 27 | #+END_SRC 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /sandbox/init.el: -------------------------------------------------------------------------------- 1 | ;; (setq user-emacs-directory "sandbox") 2 | ;; (setq pacakge-user-dir "sandbox/elpa") 3 | 4 | (setq user-emacs-directory (getenv "USER_DIRECTORY")) 5 | (setq pacakge-user-dir (getenv "PACKAGE_DIR")) 6 | (setq user-init-file (getenv "INITFILE")) 7 | 8 | ;; (setq default-directory (getenv "DEFAULT_DIRECTORY")) 9 | 10 | ;;; Separate customization form init file 11 | (setq custom-file (concat (file-name-as-directory user-emacs-directory) "custom.el")) 12 | (load custom-file 'noerror) 13 | 14 | 15 | (setq package-archives 16 | '( 17 | 18 | ;;("melpa" . "https://melpa.milkbox.net/packages/") 19 | ;;("popkit" . "http://elpa.popkit.org/packages/") 20 | ("melpa" . "https://melpa.org/packages/") 21 | 22 | ;; ("org" . "http://orgmode.org/elpa/") 23 | ("gnu" . "http://elpa.gnu.org/packages/") 24 | 25 | ;; ("marmalade" . "http://marmalade-repo.org/packages/") 26 | 27 | )) 28 | 29 | (package-initialize) 30 | 31 | ;;; (package-refresh-contents) 32 | 33 | (defun packages-require (&rest packs) 34 | "Install and load a package. If the package is not available 35 | installs it automaticaly." 36 | (mapc (lambda (package) 37 | (unless (package-installed-p package) 38 | (package-install package) 39 | ;;#'package-require 40 | )) 41 | packs 42 | )) 43 | 44 | (unless (file-exists-p "elpa") 45 | (package-refresh-contents)) 46 | 47 | (unless (package-installed-p 'org-wiki) 48 | (package-install-file "../org-wiki.el")) 49 | 50 | (setq org-wiki-location-list (list 51 | ;; "wiki" 52 | (getenv "ORG_WIKI_LOCATION") 53 | )) 54 | 55 | (setq org-wiki-location (car org-wiki-location-list)) 56 | 57 | ;; (unless (file-exists-p org-wiki-location) 58 | ;; (mkdir org-wiki-location)) 59 | 60 | (packages-require 'htmlize) 61 | 62 | 63 | ;; Print environment variables in the *scratch* buffer. 64 | ;; 65 | (defun test-sandbox () 66 | "Test if the sandbox is working." 67 | (interactive) 68 | (switch-to-buffer "*scratch*") 69 | (insert (concat "user-emacs-directory = " user-emacs-directory "\n" )) 70 | (insert (concat "user-init-file = " user-init-file "\n" )) 71 | (insert (concat "package-user-dir = " package-user-dir "\n" ))) 72 | 73 | ;;; Print Sandbox environment variables to check if it works. 74 | (test-sandbox) 75 | 76 | 77 | ;;; Necessary for colored source code blocks 78 | (require 'htmlize) 79 | 80 | (require 'org-wiki) 81 | 82 | (org-wiki-index) 83 | (org-toggle-inline-images) 84 | 85 | 86 | ;;;------- Short Command Alias for fast navigation ----------.;;; 87 | 88 | (defalias 'og2h #'org-html-export-to-html) 89 | (defalias 'w-i #'org-wiki-index) 90 | (defalias 'w-s #'org-wiki-switch) 91 | (defalias 'w-h #'org-wiki-helm) 92 | (defalias 'w-in #'org-wiki-insert) 93 | (defalias 'w-hf #'org-wiki-helm-frame) 94 | (defalias 'w-hr #'org-wiki-helm-read-only) 95 | (defalias 'w-ho #'org-wiki-html-page) 96 | (defalias 'w-hu #'org-wiki-html-page2) 97 | (defalias 'w-close #'org-wiki-close) 98 | (defalias 'w-html #'org-wiki-html) 99 | (defalias 'w-hf #'org-wiki-helm-frame) 100 | 101 | (defalias 'h-c #'helm-occur) 102 | (defalias 'h-t #'helm-org-in-buffer-headings) 103 | -------------------------------------------------------------------------------- /sandbox/sandbox.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # INIT_FILE=$USER_DIR/init.el 4 | export INITFILE=$(pwd)/init.el 5 | echo "The init file is = "$INIT_FILE 6 | 7 | PACKAGE_DIR=$USER_DIR/elpa 8 | 9 | BASEDIR=$(pwd) #/sandbox 10 | 11 | export USER_DIRECTORY=$BASEDIR 12 | export PACKAGE_DIR=$BASEDIR/elpa 13 | export DEFAULT_DIR=$(pwd) 14 | export ORG_WIKI_LOCATION=$BASEDIR/wiki 15 | 16 | echo "USER_DIRECTORY = "$USER_DIRECTORY 17 | echo "PACKAGE_DIR = "$PACKAGE_DIR 18 | 19 | 20 | case $1 in 21 | run) 22 | emacs --debug-init -Q -l init.el 23 | ;; 24 | clean) 25 | rm -rf elpa/* 26 | ;; 27 | *) 28 | 29 | esac 30 | 31 | 32 | -------------------------------------------------------------------------------- /sandbox/wiki/Avionics.org: -------------------------------------------------------------------------------- 1 | #+INLUDE: theme/style.org 2 | #+TITLE: Avionics 3 | #+DESCRIPTION: 4 | #+KEYWORDS: 5 | #+STARTUP: content 6 | 7 | Related: 8 | 9 | [[wiki:index][Index]] 10 | 11 | * Avionics 12 | ** Electronics for Aviation 13 | ** Control Systems 14 | 15 | Control Systems 16 | - Closed loop systems 17 | - Control loop 18 | - Equations 19 | - Sensors, Actuators and control system 20 | - Electronic control systems 21 | 22 | 23 | #+CAPTION: Control Systems - Control loop 24 | [[file:Avionics/9d8128e1-eed1-4212-bf9e-bf5eb50eb0ef.png]] 25 | 26 | 27 | #+CAPTION: Control Systems - Block Diagram 28 | [[file:Avionics/a26fbbfb-6493-4d0d-bc99-98dda41f3a74.png]] 29 | 30 | 31 | #+CAPTION: Closed-loop systems. 32 | [[file:Avionics/63da7880-5005-4c6b-8497-bcd28d973a59.png]] 33 | 34 | -------------------------------------------------------------------------------- /sandbox/wiki/Avionics/63da7880-5005-4c6b-8497-bcd28d973a59.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/sandbox/wiki/Avionics/63da7880-5005-4c6b-8497-bcd28d973a59.png -------------------------------------------------------------------------------- /sandbox/wiki/Avionics/9d8128e1-eed1-4212-bf9e-bf5eb50eb0ef.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/sandbox/wiki/Avionics/9d8128e1-eed1-4212-bf9e-bf5eb50eb0ef.png -------------------------------------------------------------------------------- /sandbox/wiki/Avionics/a26fbbfb-6493-4d0d-bc99-98dda41f3a74.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/sandbox/wiki/Avionics/a26fbbfb-6493-4d0d-bc99-98dda41f3a74.png -------------------------------------------------------------------------------- /sandbox/wiki/Bash - Shell - Unix.org: -------------------------------------------------------------------------------- 1 | #+INCLUDE: theme/style.org 2 | #+TITLE: Bash Script 3 | 4 | [[wiki:index][index]] 5 | 6 | Related: [[wiki:Linux][Linux]] [[wiki:Python][Python]] [[wiki:The Art of Unix Programming][The Art of Unix Programming]] 7 | 8 | * Bash script 9 | ** For loops 10 | 11 | 12 | 13 | ** Patterns 14 | 15 | 16 | 17 | ** Commands 18 | 19 | #+BEGIN_SRC sh 20 | echo "Hello world" 21 | echo "Ola Mundo" 22 | echo "Hola Mundo" 23 | #+END_SRC 24 | -------------------------------------------------------------------------------- /sandbox/wiki/Circuit Boards.org: -------------------------------------------------------------------------------- 1 | #+TITLE: Avionics 2 | #+DESCRIPTION: 3 | 4 | wiki:index [[wiki:index][index]] 5 | 6 | 7 | Rasberry-PI 8 | 9 | #+CAPTION: rasberry pi circuit board 10 | [[file:Circuit%20Boards/rasberry%20pi%20circuit%20board.png]] 11 | 12 | 13 | #+CAPTION: Automated generated file name. 14 | [[file:Circuit%20Boards/b977882e-35ee-4d3a-8d46-59931ae04aeb.png]] 15 | -------------------------------------------------------------------------------- /sandbox/wiki/Circuit Boards/b977882e-35ee-4d3a-8d46-59931ae04aeb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/sandbox/wiki/Circuit Boards/b977882e-35ee-4d3a-8d46-59931ae04aeb.png -------------------------------------------------------------------------------- /sandbox/wiki/Circuit Boards/rasberry pi circuit board.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/sandbox/wiki/Circuit Boards/rasberry pi circuit board.png -------------------------------------------------------------------------------- /sandbox/wiki/Elisp.org: -------------------------------------------------------------------------------- 1 | #+INCLUDE: theme/style.org 2 | #+TITLE: Elisp 3 | #+STARTUP: showall 4 | 5 | wiki:index - [[wiki:index][index]] 6 | 7 | * Emacs Lisp Programming 8 | 9 | #+BEGIN_SRC emacs-lisp 10 | (defun insert-file-name () 11 | "Insert file name at point." 12 | (interactive) 13 | (insert (buffer-file-name))) 14 | #+END_SRC 15 | 16 | 17 | - See also: [[https://github.com/caiorss/Emacs-Elisp-Programming][Tutorial about programming Elisp and Emacs text editor customization.]] 18 | -------------------------------------------------------------------------------- /sandbox/wiki/Linux.org: -------------------------------------------------------------------------------- 1 | #+INCLUDE: theme/style.org 2 | #+TITLE: Linux 3 | #+DESCRIPTION: Dealing with Linux operating system. 4 | #+KEYWORDS: 5 | #+STARTUP: content 6 | 7 | [[wiki:index][index]] 8 | 9 | Related: [[wiki:Python][Python]] 10 | 11 | * Linux 12 | ** Linux X Unix X OSX 13 | ** Shell commands 14 | 15 | - =$ ls -la= 16 | 17 | Print CPU Information 18 | 19 | #+BEGIN_SRC sh 20 | cat /proc/cpuinfo 21 | #+END_SRC 22 | 23 | ** File 24 | 25 | PDF File - When clicked it will open with default system application. 26 | 27 | - [[wiki-asset-sys:Linux;Linux-Reference-Cheat-Sheet.pdf][Linux-Reference-Cheat-Sheet.pdf]] 28 | 29 | I got this file from: https://files.fosswire.com/2007/08/fwunixref.pdf 30 | 31 | -------------------------------------------------------------------------------- /sandbox/wiki/Linux/Linux-Reference-Cheat-Sheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/sandbox/wiki/Linux/Linux-Reference-Cheat-Sheet.pdf -------------------------------------------------------------------------------- /sandbox/wiki/Lisp Machines.org: -------------------------------------------------------------------------------- 1 | #+INCLUDE: theme/style.org 2 | #+TITLE: Lisp Machines 3 | #+STARTUP: content 4 | 5 | [[wiki:index][index]] 6 | 7 | Related: [[wiki:Elisp][Elisp]] [[wiki:Linux][Linux]] [[wiki:Python][Python]] 8 | 9 | * Lisp Machines 10 | ** Machines 11 | 12 | #+CAPTION: what is a lisp machine 13 | [[file:Lisp%20Machines/what%20is%20a%20lisp%20machine.png]] 14 | 15 | #+CAPTION: Lisp machine from late 1970 16 | [[file:Lisp%20Machines/Lisp%20machine%20from%20late%201970.png]] 17 | 18 | ** Lambda Calculus Super Power 19 | 20 | #+CAPTION: lambda calculus 21 | [[file:Lisp%20Machines/lambda%20calculus.png]] 22 | 23 | 24 | #+CAPTION: Lambda Calculus Formula 25 | [[file:Lisp%20Machines/90d582b2-e81d-46ba-916d-bd1ca0334e24.png]] 26 | -------------------------------------------------------------------------------- /sandbox/wiki/Lisp Machines/90d582b2-e81d-46ba-916d-bd1ca0334e24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/sandbox/wiki/Lisp Machines/90d582b2-e81d-46ba-916d-bd1ca0334e24.png -------------------------------------------------------------------------------- /sandbox/wiki/Lisp Machines/Lisp machine from late 1970.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/sandbox/wiki/Lisp Machines/Lisp machine from late 1970.png -------------------------------------------------------------------------------- /sandbox/wiki/Lisp Machines/lambda calculus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/sandbox/wiki/Lisp Machines/lambda calculus.png -------------------------------------------------------------------------------- /sandbox/wiki/Lisp Machines/what is a lisp machine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/sandbox/wiki/Lisp Machines/what is a lisp machine.png -------------------------------------------------------------------------------- /sandbox/wiki/Math - Calculus.org: -------------------------------------------------------------------------------- 1 | #+INCLUDE: theme/style.org 2 | #+TITLE: Math - Calculus 3 | #+DESCRIPTION: 4 | #+KEYWORDS: 5 | #+STARTUP: showall 6 | 7 | Related: 8 | 9 | [[wiki:index][index]] 10 | 11 | * Math Calculus 12 | 13 | This formula is visible with: M-x org-toggle-latex-fragments 14 | 15 | #+BEGIN_SRC latex 16 | \begin{equation} 17 | x = \frac{\sqrt(\alpha + 1000 \beta )}{100 * \alpha + \zeta} 18 | \end{equation} 19 | #+END_SRC 20 | 21 | \begin{equation} 22 | x = \frac{\sqrt(\alpha + 1000 \beta )}{100 * \alpha + \zeta} 23 | \end{equation} 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /sandbox/wiki/Python.org: -------------------------------------------------------------------------------- 1 | #+INCLUDE: theme/style.org 2 | #+TITLE: Python 3 | #+DESCRIPTION: Python programming 4 | #+STARTUP: content 5 | 6 | [[wiki:index][index]] 7 | 8 | Related: [[wiki:Bash - Shell - Unix][Bash - Shell - Unix]] 9 | 10 | * Python 11 | 12 | *** Python logo 13 | 14 | #+CAPTION: Python Logo. 15 | [[file:Python/70d62de1-b649-4651-b810-51844ea09ac5.png]] 16 | 17 | #+CAPTION: python icon test 18 | [[file:Python/python%20icon%20test.png]] 19 | 20 | *** A Pytho source code 21 | 22 | #+BEGIN_SRC python 23 | import sys 24 | import os 25 | 26 | def forEach(fn, seq): 27 | for e in seq: 28 | fn(e) 29 | 30 | forEach(print, os.listdir("/")) 31 | #+END_SRC 32 | 33 | 34 | -------------------------------------------------------------------------------- /sandbox/wiki/Python/70d62de1-b649-4651-b810-51844ea09ac5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/sandbox/wiki/Python/70d62de1-b649-4651-b810-51844ea09ac5.png -------------------------------------------------------------------------------- /sandbox/wiki/Python/python icon test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/sandbox/wiki/Python/python icon test.png -------------------------------------------------------------------------------- /sandbox/wiki/Quotes.org: -------------------------------------------------------------------------------- 1 | #+INCLUDE: theme/style.org 2 | #+TITLE: Quotes 3 | #+DESCRIPTION: 4 | #+KEYWORDS: 5 | #+STARTUP: overview 6 | 7 | Related: 8 | 9 | [[wiki:index][Index]] 10 | 11 | * Quotes 12 | ** Unix 13 | 14 | #+BEGIN_QUOTE 15 | This is the Unix philosophy: Write programs that do one thing and do 16 | it well. Write programs to work together. Write programs to handle 17 | text streams, because that is a universal interface. 18 | 19 | -- Doug McIlroy 20 | #+END_QUOTE 21 | 22 | ** DSL 23 | 24 | #+BEGIN_QUOTE 25 | A domain-specific language (DSL) is a programming language or 26 | executable specification language that offers, through appropriate 27 | notations and abstractions, expressive power focused on, and usually 28 | restricted to, a particular problem domain. 29 | 30 | (van Deursen et al., 2000) 31 | 32 | #+END_QUOTE 33 | ** Functional Programming 34 | 35 | #+BEGIN_QUOTE 36 | One of the distinguishing features of functional programming is the 37 | widespread use of combinators to construct programs. A combinator is a 38 | function which builds program fragments from program fragments; in a 39 | sense the programmer using combinators constructs much of the desired 40 | program automatically, rather that writing every detail by hand. 41 | 42 | - John Hughes - [[http://www.cse.chalmers.se/~rjmh/Papers/arrows.pdf][Generalizing Monads to Arrows]] 43 | #+END_QUOTE 44 | -------------------------------------------------------------------------------- /sandbox/wiki/The Art of Unix Programming.org: -------------------------------------------------------------------------------- 1 | #+INCLUDE: theme/style.org 2 | #+TITLE: The Art of Unix Programming 3 | #+DESCRIPTION: Everything about UNIX 4 | #+STARTUP: content 5 | 6 | 7 | [[wiki:index][index]] 8 | 9 | Related: [[wiki:Linux][Linux]] [[wiki:Bash - Shell - Unix][Bash - Shell - Unix]] [[wiki:Python][Python]] [[wiki:Circuit Boards][Circuit Boards]] 10 | 11 | * Unix 12 | ** Bell Labs 13 | ** AT & T - Ken Thompson and 14 | 15 | #+CAPTION: Ken Thimpson quote about Unix 16 | [[file:The%20Art%20of%20Unix%20Programming/500f61dd-afb2-41ca-83e6-0742fcbdce86.png]] 17 | 18 | 19 | #+CAPTION: The heros, the pioneers and their legacy. 20 | [[file:The%20Art%20of%20Unix%20Programming/d4499b37-fbf6-476f-812d-63d8ea88241d.png]] 21 | 22 | ** Unix Emulator 23 | 24 | #+CAPTION: An unix emulator 25 | [[file:The%20Art%20of%20Unix%20Programming/An%20unix%20emulator.png]] 26 | -------------------------------------------------------------------------------- /sandbox/wiki/The Art of Unix Programming/500f61dd-afb2-41ca-83e6-0742fcbdce86.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/sandbox/wiki/The Art of Unix Programming/500f61dd-afb2-41ca-83e6-0742fcbdce86.png -------------------------------------------------------------------------------- /sandbox/wiki/The Art of Unix Programming/7ef13361-0a05-410d-a4c1-e4cc90c4a644.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/sandbox/wiki/The Art of Unix Programming/7ef13361-0a05-410d-a4c1-e4cc90c4a644.png -------------------------------------------------------------------------------- /sandbox/wiki/The Art of Unix Programming/9dfb3b14-9ea4-4ea5-aaaf-1bd05eab6e96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/sandbox/wiki/The Art of Unix Programming/9dfb3b14-9ea4-4ea5-aaaf-1bd05eab6e96.png -------------------------------------------------------------------------------- /sandbox/wiki/The Art of Unix Programming/An unix emulator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/sandbox/wiki/The Art of Unix Programming/An unix emulator.png -------------------------------------------------------------------------------- /sandbox/wiki/The Art of Unix Programming/d4499b37-fbf6-476f-812d-63d8ea88241d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/sandbox/wiki/The Art of Unix Programming/d4499b37-fbf6-476f-812d-63d8ea88241d.png -------------------------------------------------------------------------------- /sandbox/wiki/index.org: -------------------------------------------------------------------------------- 1 | #+INCLUDE: theme/style.org 2 | #+TITLE: This is the index 3 | #+STARTUP: showall 4 | 5 | 6 | * Index 7 | ** Programming 8 | 9 | - [[wiki:Elisp][Elisp]] 10 | 11 | - [[wiki:Python][Python]] 12 | 13 | - [[wiki:Bash%20-%20Shell%20-%20Unix][Bash - Shell - Unix]] 14 | 15 | - [[wiki:Linux][Linux]] 16 | 17 | - [[wiki:The%20Art%20of%20Unix%20Programming][The Art of Unix Programming]] 18 | 19 | ** Electronics 20 | 21 | - [[wiki:Lisp%20Machines][Lisp Machines]] 22 | 23 | - [[wiki:Avionics][Avionics]] 24 | 25 | - [[wiki:Circuit%20Boards][Circuit Boards]] 26 | 27 | ** Math Calculus 28 | 29 | - [[wiki:Math%20-%20Calculus][Math - Calculus]] 30 | 31 | ** Misc 32 | 33 | - [[wiki:Quotes][Quotes]] 34 | 35 | ** Images 36 | 37 | 38 | 39 | #+CAPTION: Org-mode Logo 40 | [[file:index/fc0e0018-5a55-4f71-9c84-3d01a1cd46e4.png]] 41 | 42 | #+CAPTION: scala logo - A scalable Language. 43 | [[file:index/scala%20logo.png]] 44 | 45 | ** Tables 46 | 47 | 48 | | Description | Command | | 49 | |------------------------------+-------------------------------+---| 50 | | Toggle inline images | M-x org-toggle-inline-images | | 51 | | Toggle inline Latex Formulas | M-x org-toggle-latex-fragment | | 52 | | Toggle hyperlinks | M-x org-toggle-link-display | | 53 | 54 | 55 | 56 | ** Lorem Ipsum 57 | 58 | Lorem ipsum dolor sit amet, idque albucius eum te, est at summo falli 59 | dictas. Nam iuvaret ancillae delicatissimi ex, diam stet aperiam est 60 | an. Ut est illum consulatu, ius nisl virtute te. Cum mundi efficiantur 61 | id, his agam senserit cu, eu graeci quodsi feugait nam. Ex pri homero 62 | sententiae argumentum, in eum solet labore utamur, accusam praesent 63 | laboramus eam cu. Quas insolens eu has, et vix repudiandae 64 | voluptatibus. 65 | 66 | Ius soleat accumsan accommodare ne, ad dico nulla nam, regione 67 | splendide persequeris in est. Pri ad dico iuvaret scriptorem. Ad duo 68 | facilisis aliquando theophrastus, cum ea blandit maluisset. Sea te 69 | dolore omittam, eu mea quas equidem gloriatur, id case assum commune 70 | sed. Sonet soleat praesent his ad. 71 | 72 | Eum eu aliquip virtute, ius nisl singulis explicari ut. Cum graece 73 | oporteat in. Duo minimum accumsan cu. No enim melius comprehensam 74 | per. Doctus persius sit at. Vel nemore docendi nominavi cu. 75 | 76 | Ne nec amet repudiare elaboraret. Qui id alii malis commune, tamquam 77 | impedit pericula ius ex. Pro eu minim mazim. Eu ius impedit 78 | quaerendum, eum ea iudico aliquam. 79 | 80 | Per cu illum dolor, ad sed nisl insolens. Reque delenit eu mea, mel ex 81 | modo saepe singulis, vim quodsi accommodare te. Cum ut placerat 82 | invidunt, petentium iudicabit ad nam. Iusto deserunt hendrerit per te, 83 | sit in atqui labore. Eum autem quidam te, no his quod putent 84 | consectetuer. Eum porro sanctus propriae eu, tempor suscipiantur in 85 | nec, mel aeque tollit contentiones ut. Malis error soleat sed te, mea 86 | nemore intellegat theophrastus no. 87 | -------------------------------------------------------------------------------- /sandbox/wiki/index/fc0e0018-5a55-4f71-9c84-3d01a1cd46e4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/sandbox/wiki/index/fc0e0018-5a55-4f71-9c84-3d01a1cd46e4.png -------------------------------------------------------------------------------- /sandbox/wiki/index/scala logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/sandbox/wiki/index/scala logo.png -------------------------------------------------------------------------------- /sandbox/wiki/ltximg/org-ltximg_3ea6764663d441dda6304b7781dcbe0bd5ae1322.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/sandbox/wiki/ltximg/org-ltximg_3ea6764663d441dda6304b7781dcbe0bd5ae1322.png -------------------------------------------------------------------------------- /sandbox/wiki/ltximg/org-ltximg_ce4ae9de4baa41059dfda725c807905761b3d088.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caiorss/org-wiki/3654e4f3b63ff7ec40b64f28c5e6af1ef1278ee2/sandbox/wiki/ltximg/org-ltximg_ce4ae9de4baa41059dfda725c807905761b3d088.png -------------------------------------------------------------------------------- /sandbox/wiki/theme/org-info.js: -------------------------------------------------------------------------------- 1 | function OrgNode(e,h,f,g,d,b,j){var i=this;i.D=e;i.I=b;i.J=-1;i.H=h;i.L=f;i.HH=false; 2 | i.P=d;i.DRT=false;i.ST=OrgNode.SF;i.TOC=j;i.DEPTH=g;i.F=null;i.CH=new Array();i.NAV=""; 3 | i.BS=null;if(null!=i.P){i.P.addChild(this);i.hide();}var a=document.getElementById("text-"+i.I); 4 | if(null==a&&b){var c=b.substring(4);a=document.getElementById("text-"+c);}if(null!=a){i.F=a; 5 | }i.iTF=new Object();i.iTF["#"+i.I]=2;OrgNode.fTI(i.iTF,i.H,1);OrgNode.fTI(i.iTF,i.F,3); 6 | }OrgNode.SF=0;OrgNode.SH=1;OrgNode.SU=2;OrgNode.fTI=function(f,c,e){if(c){var b=c.getElementsByTagName("a"); 7 | if(b){for(var d=0;d2){this.P.show(); 20 | }};OrgNode.prototype.sAC=function(){for(var a=0;a]+>/i,ORGTAGX:/^(.*)(]+>[^<]+<\/span>)+<\/span>/i,TRIMMER:/^(\s*)([^\s].*)(\s*)$/,TOC:null,RUNS:0,H:new Array(50),HI:0,SKIP_H:false,FIXED_TOC:false,C:null,CI:null,CL:null,CO:"50px",OCCUR:"",SCX:"",SC_HLX:new RegExp('()([^<]*?)()',"gi"),Mg:0,MgI:1,MgT:2,Hg:false,Rg:false,RC:"",RC_NULL:"_0",RC_H:"_1",RC_O:"_2",RC_P:"_03",LVM:0,TAB_INDEX:1000,SHO:false,TAGS:{},ST:new Array(),TAGS_INDEX:null,CTO:null,SN_MAP:{},TL:null,HOOKS:{run_hooks:false,onShowSection:[],onReady:[]},setup:function(){var d=this; 32 | if(window.orgInfoHooks){for(var c in orgInfoHooks){d.HOOKS[c]=orgInfoHooks[c];}d.HOOKS.run_hooks=false; 33 | }if(location.search){var e=location.search.substring(1).split("&");for(var c=0;cUp / ':"")+((d.LINK_HOME&&d.LINK_HOME!=document.URL)?'HOME / ':"")+'HELP / '; 41 | d.LOAD_CHECK=window.setTimeout("OrgHtmlManagerLoadCheck()",50);},trim:function(a){var b=this.TRIMMER.exec(a); 42 | return RegExp.$2;},rT:function(a){if(a){while(a.match(this.UNTAGX)){a=a.substr(0,a.indexOf("<"))+a.substr(a.indexOf(">")+1); 43 | }}return a;},rOT:function(a){if(a.match(this.ORGTAGX)){var b=this.ORGTAGX.exec(a); 44 | return b[1];}return a;},init:function(){var m=this;m.RUNS++;m.B=document.getElementById("content"); 45 | if(null==m.B){if(5>m.RUNS){m.LOAD_CHECK=window.setTimeout("OrgHtmlManagerLoadCheck()",m.RUN_INTERVAL); 46 | return;}else{m.B=document.getElementsByTagName("body")[0];}}if(!m.W){m.W=document.createElement("div"); 47 | m.W.style.marginBottom="40px";m.W.id="org-info-js-window";}var l=document.getElementById("table-of-contents"); 48 | if(!m.initFromTOC()){if(m.RUNS
 
 
'; 55 | m.C.style.position="relative";m.C.style.marginTop="-"+m.CO;m.C.style.top="-"+m.CO; 56 | m.C.style.left="0px";m.C.style.width="100%";m.C.style.height="40px";m.C.style.overflow="hidden"; 57 | m.C.style.verticalAlign="middle";m.C.style.zIndex="9";m.C.style.border="0px solid #cccccc"; 58 | m.C.id="org-info-js_console-container";m.B.insertBefore(m.C,m.B.firstChild);m.Mg=false; 59 | m.CL=document.getElementById("org-info-js_console-label");m.CI=document.getElementById("org-info-js_console-input"); 60 | document.onkeypress=OrgHtmlManagerKeyEvent;if(m.VIEW==m.INFO_VIEW){m.iV(d);m.ss(d); 61 | window.setTimeout(function(){window.scrollTo(0,0);},100);}else{if(m.VIEW==m.SLIDE_VIEW){m.sV(d); 62 | m.ss(d);}else{var k=m.VIEW;m.pV(d,1);m.R.DRT=true;m.R_STATE=OrgNode.SU;m.tG();if(k>m.PLAIN_VIEW){m.tG(); 63 | }if(k==m.ALL_VIEW){m.tG();}if(f){m.ss(d);}}}if(""!=m.OCCUR){m.CI.value=m.OCCUR;m.RC="o"; 64 | m.eRC();}if(m.STARTUP_MESSAGE){m.warn("This page uses org-info.js. Press '?' for more information.",true); 65 | }m.HOOKS.run_hooks=true;m.runHooks("onReady",this.N);},initFromTOC:function(){var k=this; 66 | if(k.RUNS==1||!k.R){var b=document.getElementById("table-of-contents");if(null!=b){var m=null; 67 | var d=0;for(d;m==null&&d<7;++d){m=b.getElementsByTagName("h"+d)[0];}m.onclick=function(){org_html_manager.fold(0); 68 | };m.style.cursor="pointer";if(k.MOUSE_HINT){m.onmouseover=function(){org_html_manager.hH(0); 69 | };m.onmouseout=function(){org_html_manager.unhH(0);};}if(k.FIXED_TOC){m.setAttribute("onclick","org_html_manager.tG();"); 70 | k.R=new OrgNode(null,k.B.getElementsByTagName("h1")[0],"javascript:org_html_manager.go(0);",0,null); 71 | k.TOC=new OrgNode(b,m,"javascript:org_html_manager.go(0);",d,null);k.N=k.R;}else{k.R=new OrgNode(null,k.B.getElementsByTagName("h1")[0],"javascript:org_html_manager.go(0);",0,null); 72 | if(k.HIDE_TOC){k.TOC=new OrgNode(b,"","javascript:org_html_manager.go(0);",d,null); 73 | k.N=k.R;OrgNode.hE(b);}else{k.TOC=new OrgNode(b,m,"javascript:org_html_manager.go(0);",d,k.R); 74 | k.TOC.J=0;k.N=k.TOC;k.S.push(k.TOC);}}if(k.TOC){k.TOC.F=document.getElementById("text-table-of-contents"); 75 | }}else{return false;}}var j=k.TOC.F.getElementsByTagName("ul")[0];if(!k.ulToOutlines(j)){return false; 76 | }var h=document.getElementById("footnotes");if(h){var a=null;var f=h.childNodes;for(var d=0; 77 | dthis.TOC_DEPTH){a.removeChild(g); 92 | }else{this.cutToc(g,f);}}}}}},mkNodeFromHref:function(g){s=g.href;if(s.match(this.REGEX)){var k=this.REGEX.exec(s); 93 | var c=k[2];var l=document.getElementById(c);if(null==l){return(false);}var a=l.parentNode; 94 | var m=this.S.length;var f=a.className.substr(8);l.onclick=function(){org_html_manager.fold(""+m); 95 | };l.style.cursor="pointer";if(this.MOUSE_HINT){l.onmouseover=function(){org_html_manager.hH(""+m); 96 | };l.onmouseout=function(){org_html_manager.unhH(""+m);};}var o="javascript:org_html_manager.go("+m+")"; 97 | if(f>this.N.DEPTH){this.N=new OrgNode(a,l,o,f,this.N,c,g);}else{if(f==2){this.N=new OrgNode(a,l,o,f,this.R,c,g); 98 | }else{var b=this.N;while(b.DEPTH>f){b=b.P;}this.N=new OrgNode(a,l,o,f,b.P,c,g);}}this.S.push(this.N); 99 | var n=l.getElementsByTagName("span");if(n){for(var e=0;e'+this.LINKS+'toggle view'; 104 | if(d>0){c+='Previous | '; 105 | }else{c+="Previous | ";}if(dNext'; 106 | }else{c+="Next";}c+=''; 107 | if(d>0&&this.S[d].P.P){c+=''+this.S[d].P.H.innerHTML+""; 108 | }else{c+=''+this.S[d].H.innerHTML+""; 109 | }c+=''; 110 | c+=(d+1)+"";this.S[d].BS=document.createElement("div");this.S[d].BS.innerHTML='
'+this.LINKS+'toggle view
'; 111 | if(this.S[d].F){this.S[d].D.insertBefore(this.S[d].BS,this.S[d].H);}else{if(this.S[d].D.hasChildNodes()){this.S[d].D.insertBefore(this.S[d].BS,this.S[d].D.firstChild); 112 | }}if(!this.VIEW_BUTTONS){OrgNode.hE(this.S[d].BS);}this.S[d].NAV=c;if(0'+this.rT(this.rOT(this.S[d].CH[b].H.innerHTML))+""; 115 | }c+="";a.innerHTML=c;if("above"==this.LOCAL_TOC){if(this.S[d].F){this.S[d].F.insertBefore(a,this.S[d].F.firstChild); 116 | }else{this.S[d].D.insertBefore(a,this.S[d].D.getElementsByTagName("h"+this.S[d].DEPTH)[0].nextSibling); 117 | }}else{if(this.S[d].F){this.S[d].F.appendChild(a);}else{this.S[d].D.appendChild(a); 118 | }}}}this.ST.sort();},set:function(eval_key,eval_val){if("VIEW"==eval_key){var pos=eval_val.indexOf("_"); 119 | if(-1!=pos){this.IT=eval_val.substr(pos+1);eval_val=eval_val.substr(0,pos);}var overview=this.PLAIN_VIEW; 120 | var content=this.CONTENT_VIEW;var showall=this.ALL_VIEW;var info=this.INFO_VIEW;var info_title_above=this.INFO_VIEW; 121 | var slide=this.SLIDE_VIEW;eval("this."+eval_key+"="+eval_val+";");}else{if("HELP"==eval_key){eval("this.STARTUP_MESSAGE="+eval_val+";"); 122 | }else{if(eval_val){eval("this."+eval_key+"='"+eval_val+"';");}else{eval("this."+eval_key+"=0;"); 123 | }}}},convertLinks:function(){var f=(this.HIDE_TOC?0:1);var e;var a=this.S.length-1; 124 | var d=document.getElementsByTagName("a");for(e=0;ethis.N.J){d=true; 149 | }if(null==g){d=true;}if(d){for(var a=this.S[f].F.firstChild;null!=a;a=a.nextSibling){if("UL"==a.nodeName){var j=a.getElementsByTagName("li"); 150 | for(var c=1;c0){if(OrgNode.isHidden(b)){OrgNode.uhE(b);if(c<(j.length-1)){k=false; 153 | }if(00){b.go(a-1);}else{b.warn("Already first section.");}},go:function(b){var a=this; 170 | if(a.Rg){a.eR();a.hC();}else{if(a.Mg){a.rW();}}if(a.VIEW==a.SLIDE_VIEW){a.adjustSlide(b); 171 | }a.puH(b,a.N.J);a.ss(b);},puH:function(c,a){var b=this;if(!b.SKIP_H){b.H[b.HI]=new Array(c,a); 172 | b.HI=(b.HI+1)%50;}b.SKIP_H=false;b.CI.value="";},poH:function(c){var a=this;if(c){if(a.H[a.HI]){var b=parseInt(a.H[a.HI][0]); 173 | if(!isNaN(b)||"?/toc/?"==a.H[a.HI][0]){a.ss(a.H[a.HI][0]);a.CI.value="";}else{a.SKIP_H=true; 174 | a.CI.value=a.H[a.HI][0];a.getKey();}a.HI=(a.HI+1)%50;a.HBO=0;}else{if(a.HFO&&history.length){history.forward(); 175 | }else{a.HFO=1;a.warn("History: No where to foreward go from here. Any key and `B' to move to next file in history."); 176 | }}}else{if(a.H[a.HI-1]){a.HI=a.HI==0?49:a.HI-1;var b=parseInt(a.H[a.HI][1]);if(!isNaN(b)||"?/toc/?"==a.H[a.HI][1]){a.ss(a.H[a.HI][1]); 177 | a.CI.value="";}else{a.SKIP_H=true;a.CI.value=a.H[a.HI][1];a.getKey();}a.HFO=0;}else{if(a.HBO&&history.length){history.back(); 178 | }else{a.HBO=1;a.warn("History: No where to back go from here. Any key and `b' to move to previous file in history."); 179 | }}}},warn:function(c,d,b){var a=this;if(null==b){b="";}a.CI.value=b;if(!d){a.CL.style.color="red"; 180 | }a.CL.innerHTML=""+c+"(press any key to proceed)"; 181 | a.sC();window.setTimeout(function(){org_html_manager.CI.value=b;},50);},sR:function(e,b,d,a){var c=this; 182 | if(null==d){d="";}if(null==a){a="";}c.RC=e;c.Rg=true;c.CL.innerHTML=""+b+"("+a+"RET to close)"; 183 | c.sC();document.onkeypress=null;c.CI.focus();c.CI.onblur=function(){org_html_manager.CI.focus(); 184 | };window.setTimeout(function(){org_html_manager.CI.value=d;},50);},eR:function(c,a){var b=this; 185 | b.Rg=false;b.RC="";b.CI.onblur=null;b.CI.blur();document.onkeypress=OrgHtmlManagerKeyEvent; 186 | },rW:function(){var a=this;a.CL.style.color="#333333";a.hC();},sC:function(){var a=this; 187 | if(!a.Mg){if(a.VIEW==a.PLAIN_VIEW){a.B.removeChild(a.B.firstChild);a.N.D.insertBefore(a.C,a.N.D.firstChild); 188 | a.N.D.scrollIntoView(true);a.Mg=a.MgI;}else{a.Mg=a.MgT;window.scrollTo(0,0);}a.C.style.marginTop="0px"; 189 | a.C.style.top="0px";}},hC:function(){var a=this;if(a.Mg){a.C.style.marginTop="-"+a.CO; 190 | a.C.style.top="-"+a.CO;a.CL.innerHTML="";a.CI.value="";if(a.MgI==a.Mg){a.N.D.removeChild(a.N.D.firstChild); 191 | a.B.insertBefore(a.C,a.B.firstChild);if(a.N.J!=0){a.N.D.scrollIntoView();}}a.Mg=false; 192 | }},getKey:function(){var b=this;var c=b.CI.value;if(0==c.length){if(b.Hg){b.showHelp(); 193 | return;}if(b.Mg&&!b.Rg){b.rW();}return;}if(b.Mg&&!b.Rg){b.rW();return;}else{if(b.Hg){b.showHelp(); 194 | b.CI.value="";return;}else{if(b.Rg){return;}}}b.CI.value="";b.CI.blur();if(b.HIDE_TOC&&b.TOC==b.N&&"v"!=c&&"V"!=c&&"\t"!=c){c="b"; 195 | }else{if("\t"==c){return true;}else{c=b.trim(c);}}if(1==c.length){if("b"==c){b.poH(); 196 | }else{if("B"==c){b.poH(true);}else{if("c"==c){b.rSH();if(b.VIEW==b.INFO_VIEW||b.VIEW==b.SLIDE_VIEW){b.ss(b.N.J); 197 | }}else{if("i"==c){if(!b.FIXED_TOC){if(b.HIDE_TOC){b.go("?/toc/?");}else{if(0!=b.N.J){b.go(0); 198 | }}}if(null!=b.TL){b.TL.focus();}}else{if("m"==c){b.toggleView(b.N.J);return;}else{if("x"==c){b.sV(b.N.J); 199 | }else{if("n"==c){if(b.N.ST==OrgNode.SF&&b.VIEW==b.PLAIN_VIEW){b.ss(b.N.J);}else{if(b.N.J=e){if(b.S[a].DEPTH==e){b.go(a); 202 | return;}++a;}}b.warn("No next sibling.");return;}else{if("p"==c){if(b.N.J>0){b.go(b.N.J-1); 203 | }else{b.warn("Already first section.");return;}}else{if("P"==c){if(b.N.J>0){var e=b.N.DEPTH; 204 | var a=b.N.J-1;while(a>=0&&b.S[a].DEPTH>=e){if(b.S[a].DEPTH==e){b.go(a);return;}--a; 205 | }}b.warn("No previous sibling.");}else{if("q"==c){if(window.confirm("Really close this file?")){window.close(); 206 | }}else{if("<"==c||"t"==c){if(0!=b.N.J){b.go(0);}else{window.scrollTo(0,0);}}else{if(">"==c||"E"==c||"e"==c){if((b.S.length-1)!=b.N.J){b.go(b.S.length-1); 207 | }else{b.S[b.S.length-1].D.scrollIntoView(true);}}else{if("v"==c){if(window.innerHeight){window.scrollBy(0,window.innerHeight-30); 208 | }else{if(document.documentElement.clientHeight){window.scrollBy(0,document.documentElement.clientHeight-30); 209 | }else{window.scrollBy(0,document.body.clientHeight-30);}}}else{if("V"==c){if(window.innerHeight){window.scrollBy(0,-(window.innerHeight-30)); 210 | }else{if(document.documentElement.clientHeight){window.scrollBy(0,-(document.documentElement.clientHeight-30)); 211 | }else{window.scrollBy(0,-(document.body.clientHeight-30));}}}else{if("u"==c){if(b.N.P!=b.R){b.N=b.N.P; 212 | b.ss(b.N.J);}}else{if("W"==c){b.pV(b.N.J);b.R.DRT=true;b.R_STATE=OrgNode.SU;b.tG(); 213 | b.tG();b.tG();window.print();}else{if("f"==c){if(b.VIEW!=b.INFO_VIEW){b.N.fold(); 214 | b.N.D.scrollIntoView(true);}}else{if("F"==c){if(b.VIEW!=b.INFO_VIEW){b.tG();b.N.D.scrollIntoView(true); 215 | }}else{if("?"==c||"¿"==c){b.showHelp();}else{if("C"==c){if(b.ST.length){b.showTagsIndex(); 216 | }else{b.warn("No Tags found.");}}else{if("H"==c&&b.LINK_HOME){window.document.location.href=b.LINK_HOME; 217 | }else{if("h"==c&&b.LINK_UP){window.document.location.href=b.LINK_UP;}else{if("l"==c){if(""!=b.OCCUR){b.sR(b.RC_H,"Choose HTML-link type: 's' = section, 'o' = occur"); 218 | }else{b.sR(c,"HTML-link:",''+document.title+", Sec. '"+b.rT(b.N.H.innerHTML)+"'","C-c to copy, "); 219 | window.setTimeout(function(){org_html_manager.CI.select();},100);}return;}else{if("L"==c){if(""!=b.OCCUR){b.sR(b.RC_O,"Choose Org-link type: 's' = section, 'o' = occur"); 220 | }else{b.sR(c,"Org-link:","[["+b.BU+b.dT()+"]["+document.title+", Sec. '"+b.rT(b.N.H.innerHTML)+"']]","C-c to copy, "); 221 | window.setTimeout(function(){org_html_manager.CI.select();},100);}return;}else{if("U"==c){if(""!=b.OCCUR){b.sR(b.RC_P,"Choose Org-link type: 's' = section, 'o' = occur"); 222 | }else{b.sR(c,"Plain URL Link:",b.BU+b.dT(),"C-c to copy, ");window.setTimeout(function(){org_html_manager.CI.select(); 223 | },100);}return;}else{if("g"==c){b.sR(c,"Enter section number:");return;}else{if("o"==c){if(""!=b.OCCUR){b.sR(c,"Occur:",b.OCCUR,"RET to use previous, DEL "); 224 | }else{b.sR(c,"Occur:",b.OCCUR);}window.setTimeout(function(){org_html_manager.CI.value=org_html_manager.OCCUR; 225 | org_html_manager.CI.select();},100);return;}else{if("s"==c){if(""!=b.OCCUR){b.sR(c,"Search forward:",b.OCCUR,"RET to use previous, DEL "); 226 | }else{b.sR(c,"Search forward:",b.OCCUR);}window.setTimeout(function(){org_html_manager.CI.value=org_html_manager.OCCUR; 227 | org_html_manager.CI.select();},100);return;}else{if("S"==c){if(""==b.OCCUR){c="s"; 228 | b.sR(c,"Search forward:");}else{b.RC=c;b.eRC();}return;}else{if("r"==c){if(""!=b.OCCUR){b.sR(c,"Search backwards:",b.OCCUR,"RET to use previous, DEL "); 229 | }else{b.sR(c,"Search backwards:",b.OCCUR);}window.setTimeout(function(){org_html_manager.CI.value=org_html_manager.OCCUR; 230 | org_html_manager.CI.select();},100);return;}else{if("R"==c){if(""==b.OCCUR){c="r"; 231 | b.sR(c,"Search backwards:");}else{b.RC=c;b.eRC();}return;}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}return; 232 | },eRC:function(){var j=this;var a=j.RC;var k=j.trim(j.CI.value);j.eR();if(""==a||""==k){j.hC(); 233 | return;}if(a=="g"){var f=j.SN_MAP[k];if(null!=f){j.hC();j.go(f.J);return;}j.warn("Goto section: no such section.",false,k); 234 | return;}else{if(a=="s"){if(""==k){return false;}if(j.SHO){j.rSH();}var g=j.OCCUR; 235 | var e=0;if(k==j.OCCUR){e++;}j.OCCUR=k;j.mSR();for(var d=j.N.J+e;d-1;--d){if(j.sIO(d)){j.hC(); 241 | j.go(j.S[d].J);return;}}j.warn("Search backwards: text not found.",false,j.OCCUR); 242 | j.OCCUR=g;return;}else{if(a=="R"){for(var d=j.N.J-1;d>-1;--d){k=j.rT(j.S[d].H.innerHTML); 243 | if(j.sIO(d)){j.hC();j.go(j.S[d].J);return;}}j.warn("Search backwards: text not found.",false,j.OCCUR); 244 | return;}else{if(a=="o"){if(""==k){return false;}if(j.SHO){j.rSH();}var g=j.OCCUR; 245 | j.OCCUR=k;j.mSR();var b=new Array();for(var d=0;d=1;--d){OrgNode.sE(j.S[b[d]].F); 249 | }j.ss(b[0]);}else{if(a==j.RC_O){var h=k.charAt(0);if("s"==h){j.sR(j.RC_NULL,"Org-link to this section:","[["+j.BU+j.dT()+"]["+document.title+", Sec. '"+j.rT(j.N.H.innerHTML)+"']]","C-c to copy, "); 250 | window.setTimeout(function(){org_html_manager.CI.select();},100);}else{if("o"==h){j.sR(j.RC_NULL,"Org-link, occurences of ""+j.OCCUR+"":","[["+j.BU+"?OCCUR="+j.OCCUR+"]["+document.title+", occurences of '"+j.OCCUR+"']]","C-c to copy, "); 251 | window.setTimeout(function(){org_html_manager.CI.select();},100);}else{j.warn(h+": No such link type!"); 252 | }}}else{if(a==j.RC_H){var h=k.charAt(0);if("s"==h){j.sR(j.RC_NULL,"HTML-link to this section:",''+document.title+", Sec. '"+j.rT(j.N.H.innerHTML)+"'","C-c to copy, "); 253 | window.setTimeout(function(){org_html_manager.CI.select();},100);}else{if("o"==h){j.sR(j.RC_NULL,"HTML-link, occurences of ""+j.OCCUR+"":",''+document.title+", occurences of '"+j.OCCUR+"'","C-c to copy, "); 254 | window.setTimeout(function(){org_html_manager.CI.select();},100);}else{j.warn(h+": No such link type!"); 255 | }}}else{if(a==j.RC_P){var h=k.charAt(0);if("s"==h){j.sR(j.RC_NULL,"Plain-link to this section:",j.BU+j.dT(),"C-c to copy, "); 256 | window.setTimeout(function(){org_html_manager.CI.select();},100);}else{if("o"==h){j.sR(j.RC_NULL,"Plain-link, occurences of ""+j.OCCUR+"":",j.BU+"?OCCUR="+j.OCCUR,"C-c to copy, "); 257 | window.setTimeout(function(){org_html_manager.CI.select();},100);}else{j.warn(h+": No such link type!"); 258 | }}}}}}}}}}}},dT:function(b){if(null==b){b=this.N;}var c="#"+this.N.I;for(var a in b.iTF){if(!a.match(this.SIDX)){c=a; 259 | break;}}return c;},mSR:function(){var a=this.OCCUR.replace(/>/g,">").replace(/]").replace(/\"/g,"""); 260 | this.SCX=new RegExp(">([^<]*)?("+a+")([^>]*)?<","ig");},sIO:function(c){var b=this; 261 | var a=false;if(null!=b.S[c]){if(b.SCX.test(b.S[c].H.innerHTML)){a=true;b.sSH(b.S[c].H); 262 | b.S[c].HH=true;b.SHO=true;}if(b.SCX.test(b.S[c].F.innerHTML)){a=true;b.sSH(b.S[c].F); 263 | b.S[c].HH=true;b.SHO=true;}return a;}return false;},sSH:function(b){var a=b.innerHTML; 264 | b.innerHTML=a.replace(this.SCX,'>$1$2$3<'); 265 | },rSH:function(){var c=this;for(var b=0;bclick here to proceed.

Keyboard Shortcuts

org-info.js, v. 0.1.7.1
? / ¿show this help screen
Moving around
n / pgoto the next / previous section
N / Pgoto the next / previous sibling
t / Egoto the first / last section
ggoto section...
ugo one level up (parent section)
i / Cshow table of contents / tags index
b / Bgo back to last / forward to next visited section.
h / Hgo to main index in this directory / link HOME page
View
m / xtoggle the view mode between info and plain / slides
f / Ffold current section / whole document (plain view only)
Searching
s / rsearch forward / backward....
S / Rsearch again forward / backward
ooccur-mode
cclear search-highlight
Misc
l / L / Udisplay HTML link / Org link / Plain-URL
v / Vscroll down / up
WPrint

Press any key or click here to proceed.'; 273 | window.scrollTo(0,0);}else{if(a.PLAIN_VIEW==a.LVM){a.pV();}else{if(a.SLIDE_VIEW==a.LVM){a.sV(); 274 | }}a.ss(a.N.J);}},showTagsIndex:function(){var e=this;if(e.Rg){e.eR();}else{if(e.Mg){e.rW(); 275 | }}e.Hg=e.Hg?0:1;if(e.Hg){e.LVM=e.VIEW;if(e.PLAIN_VIEW==e.VIEW){e.iV(true);}if(null==e.TAGS_INDEX){e.TAGS_INDEX='Press any key or click here to proceed.

Click the headlines to expand the contents.

Index of Tags

'; 276 | for(var d=0;d

"+b+'

";}e.TAGS_INDEX+='
Press any key or click here to proceed.'; 280 | }e.W.innerHTML=e.TAGS_INDEX;window.scrollTo(0,0);}else{if(e.PLAIN_VIEW==e.LVM){e.pV(); 281 | }else{if(e.SLIDE_VIEW==e.LVM){e.sV();}}e.ss(e.N.J);}},runHooks:function(b,a){if(this.HOOKS.run_hooks&&this.HOOKS[b]){for(var c=0; 282 | c=0; 284 | --b){if(this.HOOKS[a][b]==c){this.HOOKS[a].splice(b,1);}}}}};function OrgHtmlManagerKeyEvent(b){var d; 285 | if(!b){b=window.event;}if(b.which){d=b.which;}else{if(b.keyCode){d=b.keyCode;}}if(b.ctrlKey){return; 286 | }var a=String.fromCharCode(d);if(b.shiftKey){org_html_manager.CI.value=org_html_manager.CI.value+a; 287 | }else{org_html_manager.CI.value=org_html_manager.CI.value+a.toLowerCase();}org_html_manager.getKey(); 288 | }function OrgHtmlManagerLoadCheck(){org_html_manager.init();} -------------------------------------------------------------------------------- /sandbox/wiki/theme/org-nav-theme.css: -------------------------------------------------------------------------------- 1 | /** 2 | - Author: Caio Rodrigues Soares Silva 3 | 4 | - Public Domain CSS Style for org-mode. 5 | 6 | - Description: CSS for long-org mode documents exported to html with long table of contents. 7 | This style creates a scrollable table of contents at the left side. 8 | 9 | ---------------------------------------------------------------------------------------- 10 | */ 11 | 12 | 13 | /** Variables */ 14 | 15 | :root { 16 | 17 | /** Table of contents settings */ 18 | --toc-width: 25%; 19 | --toc-bgcolor: lightcyan; 20 | 21 | 22 | /** Content lenght */ 23 | --main-width: 90%; 24 | 25 | --header-color: #1572AE; 26 | 27 | 28 | --max-image-width: 600px; 29 | 30 | --max-text-width: 90%; /* Max paragraph length and text in bullet lists. */ 31 | } 32 | 33 | 34 | 35 | h1 { 36 | text-align: center; 37 | } 38 | 39 | h1, ul#tabs, h2, h3, h4, h5 { 40 | font-family: "Trebuchet MS",Verdana,sans-serif; 41 | } 42 | 43 | h3, h4, h5, h6 { 44 | color: #1572AE; 45 | } 46 | 47 | 48 | /** Hyperlink General Styles */ 49 | a { 50 | color: #007bb8; 51 | cursor: pointer; 52 | text-decoration: none; 53 | -webkit-transition: none 86ms ease-out; 54 | transition: none 86ms ease-out; 55 | } 56 | 57 | a { 58 | background-color: transparent; 59 | -webkit-text-decoration-skip: objects; 60 | } 61 | 62 | 63 | body { 64 | font: 16px/1.385 arial,helvetica,clean,sans-serif; 65 | text-rendering: optimizeLegibility; 66 | 67 | /* margin-left: 50%; */ 68 | float: right; 69 | /* position: relative; */ 70 | width: var(--main-width); 71 | padding-left: 35%; 72 | /* overflow-x: scroll; */ 73 | background-color: rgba(255,255,255,1.0); 74 | /* z-index: 9999; */ 75 | } 76 | 77 | 78 | #table-of-contents { 79 | background-color: rgba(229,229,229,1.0); 80 | /* border-color: #CCCCCC #BBBBBB #888888; */ 81 | /* background-image: linear-gradient(to bottom, #7b0105 0%, #b8282c 100%); */ 82 | 83 | color: var(--header-color); 84 | width: var(--toc-width); 85 | height: 100%; 86 | float: left; 87 | position: fixed; 88 | top: 50px; 89 | bottom: 0; 90 | left: 0; 91 | /* background-color: rgba(125, 125, 125, 0.29); */ 92 | overflow-y: scroll; 93 | display: block; 94 | z-index: 9999; 95 | 96 | /** Initially hide navigation bar*/ 97 | display: none; 98 | } 99 | 100 | 101 | #table-of-contents ul { 102 | padding-left: 0px; 103 | padding-top: 5px; 104 | padding-bottom: 10px; 105 | list-style-type: none; 106 | list-style-position: inside; 107 | } 108 | 109 | #table-of-contents li { 110 | padding-left: 10px; 111 | padding-top: 15px; 112 | font-size: 10pt; 113 | } 114 | 115 | #table-of-contents a { 116 | /* color: rgba(0,0,0,1); */ 117 | font-weight: 700; 118 | color: #364149; 119 | position: relative; 120 | text-overflow: ellipsis; 121 | } 122 | 123 | #table-of-contents a:hover { 124 | color: rgba(51,102,204,1.0); 125 | text-decoration: underline; 126 | } 127 | 128 | 129 | /* ======== Paragraph formatting =================== */ 130 | 131 | p { 132 | text-indent: 25px; 133 | text-align: justify; 134 | line-height: 1.5; 135 | width: var(--max-text-width); 136 | 137 | -moz-osx-font-smoothing: grayscale; 138 | -webkit-font-smoothing: antialiased !important; 139 | -moz-font-smoothing: antialiased !important; 140 | text-rendering: optimizelegibility !important; 141 | letter-spacing: .03em; 142 | 143 | font-family: 'Merriweather', Georgia, 'Times New Roman', Times, serif; 144 | } 145 | 146 | /* ======== Image ================================== */ 147 | 148 | img{ 149 | width: 100%; 150 | max-width: var(--max-image-width); 151 | } 152 | 153 | /* ======== Table ================================== */ 154 | 155 | table { 156 | border-collapse: collapse; 157 | border-spacing: 0; 158 | width: 90%; 159 | margin-top: 20px; 160 | margin-bottom: 20px; 161 | } 162 | 163 | th { 164 | /* padding-top: 30px; */ 165 | font-weight: bold; 166 | background-color: #cccccc; 167 | /* text-align: justified; */ 168 | } 169 | 170 | th.left { 171 | text-align: left; 172 | } 173 | 174 | td,th { 175 | padding: 0; 176 | /* width: 100%; */ 177 | } 178 | 179 | /**========= Blockquote and citations ============ */ 180 | 181 | blockquote { 182 | font-family: Georgia, serif; 183 | font-style: italic; 184 | line-height: 1.45; 185 | color: #383838; 186 | /* text-align: center; */ 187 | 188 | margin: 0.25em 0; 189 | 190 | background: #f9f9f9; 191 | border-left: 10px solid #ccc; 192 | 193 | /* margin: 1.5em 10px; */ 194 | padding: 0.25em 40px; 195 | width: 80%; 196 | 197 | /* padding: 0.5em 10px; */ 198 | quotes: "\201C""\201D""\2018""\2019"; 199 | } 200 | 201 | blockquote:before { 202 | color: #ccc; 203 | content: open-quote; 204 | font-size: 4em; 205 | line-height: 0.1em; 206 | margin-right: 0.25em; 207 | vertical-align: -0.4em; 208 | } 209 | 210 | blockquote p { 211 | display: inline; 212 | } 213 | 214 | /* ======= Code block style ======================= */ 215 | 216 | 217 | code { 218 | background-color: #dbdfe0; 219 | border: 1px solid #DEDEDE; 220 | /* color: #444444; */ 221 | font-family: monospace; 222 | font-size: 10pt; 223 | margin: 0px 1px; 224 | padding: 0px 2px; 225 | overflow-x: scroll; 226 | } 227 | 228 | /* ======== Code block Syntax Highlight ======================= */ 229 | 230 | 231 | pre { 232 | font-family: "Operator Mono SSm A", "Operator Mono SSm B", 'Source Code Pro', Menlo, Consolas, Monaco, monospace; 233 | /* font-family: monospace,monospace; */ 234 | font-size: 10pt; 235 | 236 | /* background-color:#292929; */ 237 | background:#fff; 238 | 239 | /* background: #333; */ 240 | 241 | display: block; 242 | 243 | /* color:#fff; */ 244 | /* color:#555; */ 245 | 246 | padding:2em 28px; 247 | margin-top: 20px; 248 | margin-bottom: 20px; 249 | 250 | width:95%; 251 | /* float:right; */ 252 | /* clear:right; */ 253 | line-height: 25.6px; 254 | border-radius: 16px; 255 | border: 1px solid #777; 256 | box-sizing:border-box; 257 | /* text-shadow:0px 1px 2px rgba(0,0,0,0.4) */ 258 | 259 | overflow-x: scroll; 260 | } 261 | 262 | 263 | pre span.org-builtin {color:#006FE0;font-weight:bold;} 264 | pre span.org-string {color:#008000;} 265 | pre span.org-keyword {color:#0000FF;} 266 | pre span.org-variable-name {color:#BA36A5;} 267 | pre span.org-function-name {color:#006699;} 268 | pre span.org-type {color:#6434A3;} 269 | pre span.org-preprocessor {color:#808080;font-weight:bold;} 270 | pre span.org-constant {color:#D0372D;} 271 | pre span.org-comment-delimiter {color:#8D8D84;} 272 | pre span.org-comment {color:darkgreen;font-style:italic} 273 | pre span.org-outshine-level-1 {color:#8D8D84;font-style:italic} 274 | pre span.org-outshine-level-2 {color:#8D8D84;font-style:italic} 275 | pre span.org-outshine-level-3 {color:#8D8D84;font-style:italic} 276 | pre span.org-outshine-level-4 {color:#8D8D84;font-style:italic} 277 | pre span.org-outshine-level-5 {color:#8D8D84;font-style:italic} 278 | pre span.org-outshine-level-6 {color:#8D8D84;font-style:italic} 279 | pre span.org-outshine-level-7 {color:#8D8D84;font-style:italic} 280 | pre span.org-outshine-level-8 {color:#8D8D84;font-style:italic} 281 | pre span.org-outshine-level-9 {color:#8D8D84;font-style:italic} 282 | pre span.org-rainbow-delimiters-depth-1 {color:#707183;} 283 | pre span.org-rainbow-delimiters-depth-2 {color:#7388d6;} 284 | pre span.org-rainbow-delimiters-depth-3 {color:#909183;} 285 | pre span.org-rainbow-delimiters-depth-4 {color:#709870;} 286 | pre span.org-rainbow-delimiters-depth-5 {color:#907373;} 287 | pre span.org-rainbow-delimiters-depth-6 {color:#6276ba;} 288 | pre span.org-rainbow-delimiters-depth-7 {color:#858580;} 289 | pre span.org-rainbow-delimiters-depth-8 {color:#80a880;} 290 | pre span.org-rainbow-delimiters-depth-9 {color:#887070;} 291 | pre span.org-sh-quoted-exec {color:#FF1493;} 292 | 293 | pre { 294 | filter: invert(80%); 295 | } 296 | -------------------------------------------------------------------------------- /sandbox/wiki/theme/org-nav-theme.js: -------------------------------------------------------------------------------- 1 | var button = document.createElement("button") 2 | button.textContent = "Toggle"; 3 | button.style.top = "20px"; 4 | button.style.left = "30px"; 5 | button.style.position = "fixed"; 6 | button.style.zIndex = 10000; 7 | 8 | 9 | function hideNavBar(){ 10 | var toc = document.querySelector("#table-of-contents"); 11 | toc.style.display = "none"; 12 | document.documentElement.style.setProperty('--main-width', '90%'); 13 | // button.style.left = "10px"; 14 | } 15 | 16 | function showNavBar(){ 17 | var toc = document.querySelector("#table-of-contents"); 18 | toc.style.display = "block"; 19 | document.documentElement.style.setProperty('--main-width', '70%'); 20 | // button.style.left = "25%"; 21 | } 22 | 23 | var buttonFlag = false; 24 | 25 | button.addEventListener("click", function(){ 26 | if(buttonFlag == true) { 27 | hideNavBar(); 28 | buttonFlag = false; 29 | } else { 30 | showNavBar(); 31 | buttonFlag = true; 32 | } 33 | }); 34 | 35 | 36 | var init = function(){ 37 | hideNavBar(); 38 | document.body.appendChild(button); 39 | } 40 | document.addEventListener("DOMContentLoaded", init, false); 41 | 42 | -------------------------------------------------------------------------------- /sandbox/wiki/theme/style.css: -------------------------------------------------------------------------------- 1 | 2 | /*========== @group Fundamentals ============*/ 3 | 4 | * { margin: 0; padding: 0 } 5 | 6 | /* Is this portable? */ 7 | html { 8 | 9 | background:#252525; 10 | width: 100%; 11 | height: 100%; 12 | font-family: serif; 13 | font-size: 2.0em; 14 | margin-left: auto; 15 | margin-right: auto; 16 | margin-top: 2.0em; 17 | 18 | 19 | } 20 | 21 | 22 | body>div { 23 | background: white; 24 | border-bottom:1px solid #bfbfbf; 25 | background:#f2f2f2; 26 | } 27 | 28 | body>div>div { 29 | background:#f8f8f8 top left; 30 | border-right:1px solid #e0e0e0 31 | } 32 | 33 | /* ============ Body =================== */ 34 | 35 | body { 36 | margin-left: 3%; 37 | margin-right: 3%; 38 | /* font-size: 12px sans-serif; */ 39 | font-size: 1.2em; 40 | font-family: serif; 41 | font:13px/1.4 sans-serif; 42 | *font-size:small; /* for IE */ 43 | *font:x-small; /* for IE in quirks mode */ 44 | background: white; 45 | color: black; 46 | text-align: left; 47 | min-height: 100%; 48 | position: relative; 49 | } 50 | 51 | 52 | /* ======= Headlines ======== */ 53 | 54 | 55 | h1 { 56 | /* font-size: 200%; */ 57 | font-size: 2.6em; 58 | } 59 | 60 | body>header h1 { 61 | font-size:2.2em; 62 | font-family:"PT Serif","Georgia","Helvetica Neue",Arial,sans-serif; 63 | font-weight:normal; 64 | line-height:1.2em; 65 | margin-bottom:0.6667em 66 | } 67 | 68 | h2 { font-size: 131%; } 69 | h3 { font-size: 116%; } 70 | h4 { font-size: 100%; } 71 | h5 { font-size: 100%; } 72 | 73 | h1,h2,h3,h4,h5,h6 { 74 | text-rendering:optimizelegibility; 75 | margin-bottom:1em; 76 | font-weight:bold 77 | } 78 | 79 | .caption, h1, h2, h3, h4, h5, h6 { 80 | font-weight: bold; 81 | color: rgb(78,98,114); 82 | margin: 0.8em 0 0.4em; 83 | } 84 | 85 | * + h1, * + h2, * + h3, * + h4, * + h5, * + h6 { 86 | margin-top: 2em; 87 | } 88 | 89 | h1 + h2, h2 + h3, h3 + h4, h4 + h5, h5 + h6 { 90 | margin-top: inherit; 91 | } 92 | 93 | 94 | .index-button { 95 | font: bold 100% Arial; 96 | text-decoration: none; 97 | background-color: #EEEEEE; 98 | color: #333333; 99 | padding: 2px 6px 2px 6px; 100 | border-top: 1px solid #CCCCCC; 101 | border-right: 1px solid #333333; 102 | border-bottom: 1px solid #333333; 103 | border-left: 1px solid #CCCCCC; 104 | } 105 | 106 | 107 | /* ============= Table ================== */ 108 | 109 | 110 | table { 111 | font-size:inherit; 112 | font:100%; 113 | /* display: block; */ 114 | overflow: auto; 115 | border-spacing: 0; 116 | border-collapse: collapse; 117 | width: 100%; 118 | } 119 | 120 | table td { 121 | padding: 6px 13px; 122 | } 123 | 124 | /* ========= p ================= */ 125 | 126 | 127 | p { 128 | margin: 0.8em 0; 129 | font-fize: 14pt; 130 | } 131 | 132 | 133 | /* ========== Code and Pre ================ */ 134 | 135 | 136 | code { 137 | padding: 0; 138 | padding-top: 0.2em; 139 | padding-bottom: 0.2em; 140 | margin: 0; 141 | font-size: 85%; 142 | /* background-color: lightskyblue; */ 143 | background:#fff; 144 | color:#555; 145 | /* border-radius: 3px; */ 146 | border-radius: 0.3em; 147 | /* margin: 10px 0; */ 148 | 149 | 150 | display:inline-block; 151 | margin-bottom: 2.1em; 152 | } 153 | 154 | 155 | /* ======= Pre ================== * 156 | 157 | 158 | /* pre {background-color:#f3f5f7;} */ 159 | 160 | 161 | pre { 162 | background:#fff; 163 | color:#555; 164 | border: 1px solid #ccc; 165 | box-shadow: 3px 3px 3px #eee; 166 | 167 | font-family: monospace,monospace; 168 | 169 | /* overflow: auto; */ 170 | /* overflow: scroll; */ 171 | overflow-y: hidden; 172 | padding: 8pt; 173 | background-color:#f3f5f7; 174 | font-size: 85%; 175 | border-radius: 0.5em; 176 | margin: 1.2em; 177 | margin-bottom: 2.1em; 178 | } 179 | 180 | pre span.org-builtin {color:#006FE0;font-weight:bold;} 181 | pre span.org-string {color:#008000;} 182 | pre span.org-keyword {color:#0000FF;} 183 | pre span.org-variable-name {color:#BA36A5;} 184 | pre span.org-function-name {color:#006699;} 185 | pre span.org-type {color:#6434A3;} 186 | pre span.org-preprocessor {color:#808080;font-weight:bold;} 187 | pre span.org-constant {color:#D0372D;} 188 | pre span.org-comment-delimiter {color:#8D8D84;} 189 | pre span.org-comment {color:darkgreen;font-style:italic} 190 | pre span.org-outshine-level-1 {color:#8D8D84;font-style:italic} 191 | pre span.org-outshine-level-2 {color:#8D8D84;font-style:italic} 192 | pre span.org-outshine-level-3 {color:#8D8D84;font-style:italic} 193 | pre span.org-outshine-level-4 {color:#8D8D84;font-style:italic} 194 | pre span.org-outshine-level-5 {color:#8D8D84;font-style:italic} 195 | pre span.org-outshine-level-6 {color:#8D8D84;font-style:italic} 196 | pre span.org-outshine-level-7 {color:#8D8D84;font-style:italic} 197 | pre span.org-outshine-level-8 {color:#8D8D84;font-style:italic} 198 | pre span.org-outshine-level-9 {color:#8D8D84;font-style:italic} 199 | pre span.org-rainbow-delimiters-depth-1 {color:#707183;} 200 | pre span.org-rainbow-delimiters-depth-2 {color:#7388d6;} 201 | pre span.org-rainbow-delimiters-depth-3 {color:#909183;} 202 | pre span.org-rainbow-delimiters-depth-4 {color:#709870;} 203 | pre span.org-rainbow-delimiters-depth-5 {color:#907373;} 204 | pre span.org-rainbow-delimiters-depth-6 {color:#6276ba;} 205 | pre span.org-rainbow-delimiters-depth-7 {color:#858580;} 206 | pre span.org-rainbow-delimiters-depth-8 {color:#80a880;} 207 | pre span.org-rainbow-delimiters-depth-9 {color:#887070;} 208 | pre span.org-sh-quoted-exec {color:#FF1493;} 209 | 210 | 211 | 212 | /*====================*/ 213 | 214 | 215 | ul, ol { 216 | margin: 0.8em 0 0.8em 2em; 217 | } 218 | 219 | dl { 220 | margin: 0.8em 0; 221 | } 222 | 223 | dt { 224 | font-weight: bold; 225 | } 226 | 227 | dd { 228 | margin-left: 2em; 229 | } 230 | 231 | 232 | 233 | img { 234 | max-width: 500px; 235 | width: 100%; 236 | clear: both; 237 | } 238 | 239 | 240 | 241 | 242 | 243 | 244 | ul li { padding: 5px 0px; } 245 | 246 | 247 | a:hover{ 248 | color: blue; 249 | } 250 | 251 | div.wrapper { 252 | width: 500px; 253 | height: 500px; 254 | overflow: auto; 255 | } 256 | 257 | 258 | 259 | #table-of-contents { 260 | float: right; 261 | border: 1px solid #CCC; 262 | max-width: 50%; 263 | overflow: auto; 264 | } 265 | 266 | #table-of-contents { 267 | /* font-size: 9pt; */ 268 | display: none; 269 | visibility: hidden; 270 | position: fixed; 271 | right: 0em; 272 | top: 0em; 273 | background: white; 274 | /* -webkit-box-shadow: 0 0 1em #777777; */ 275 | /* -moz-box-shadow: 0 0 1em #777777; */ 276 | /* -webkit-border-bottom-left-radius: 5px; */ 277 | /* -moz-border-radius-bottomleft: 5px; */ 278 | /* text-align: right; */ 279 | max-height: 80%; 280 | overflow: auto; 281 | z-index: 200; 282 | } 283 | 284 | #table-of-contents ul { 285 | margin-left: 14pt; 286 | margin-bottom: 10pt; 287 | padding: 0 288 | } 289 | 290 | #table-of-contents li { 291 | padding: 0; 292 | margin: 1px; 293 | list-style: none; 294 | } 295 | 296 | 297 | #text-table-of-contents { 298 | display: none; 299 | visibility: hidden; 300 | text-align: left; 301 | } 302 | 303 | /* #table-of-contents:hover #text-table-of-contents { */ 304 | /* display: block; */ 305 | /* margin-top: -1.5em; */ 306 | /* padding: 0.5em; */ 307 | /* } */ 308 | 309 | 310 | 311 | #org-info-js-window 312 | { 313 | position:absolute; 314 | top:140px; 315 | /* margin-left:10%; */ 316 | margin-right: 10%; 317 | } 318 | 319 | 320 | 321 | 322 | 323 | /* =============================================== */ 324 | 325 | 326 | 327 | a { text-decoration: none; } 328 | 329 | a[href]:link { color: rgb(196,69,29); } 330 | a[href]:visited { color: rgb(171,105,84); } 331 | a[href]:hover { text-decoration:underline; } 332 | 333 | a[href].def:link, a[href].def:visited { color: black; } 334 | a[href].def:hover { color: rgb(78, 98, 114); } 335 | 336 | select, input, button, textarea { 337 | font:99% sans-serif;} 338 | 339 | kbd, samp, tt, .src { 340 | font-family:monospace; 341 | *font-size:108%; 342 | line-height: 124%; 343 | } 344 | 345 | .links, .link { 346 | font-size: 85%; /* 11pt */} 347 | 348 | #module-header .caption { 349 | font-size: 182%; /* 24pt */ 350 | } 351 | 352 | .info { 353 | font-size: 85%; /* 11pt */ 354 | } 355 | 356 | #table-of-contents, #synopsis { 357 | /* font-size: 85%; /* 11pt */ 358 | } 359 | 360 | 361 | /* @end */ 362 | 363 | /* @group Common */ 364 | 365 | ul.links { 366 | list-style: none; 367 | text-align: left; 368 | float: right; 369 | display: inline-table; 370 | margin: 0 0 0 1em; 371 | } 372 | 373 | ul.links li { 374 | display: inline; 375 | border-left: 1px solid #d5d5d5; 376 | white-space: nowrap; 377 | padding: 0; 378 | } 379 | 380 | ul.links li a { 381 | padding: 0.2em 0.5em; 382 | } 383 | 384 | .hide { display: none; } 385 | .show { display: inherit; } 386 | .clear { clear: both; } 387 | 388 | .collapser { 389 | background-image: url(minus.gif); 390 | background-repeat: no-repeat; 391 | } 392 | .expander { 393 | background-image: url(plus.gif); 394 | background-repeat: no-repeat; 395 | } 396 | .collapser, .expander { 397 | padding-left: 14px; 398 | margin-left: -14px; 399 | cursor: pointer; 400 | } 401 | 402 | p.caption.expander { 403 | background-position: 0 0.4em; 404 | } 405 | 406 | .instance.collapser, .instance.expander { 407 | margin-left: 0px; 408 | background-position: left center; 409 | min-width: 9px; 410 | min-height: 9px; 411 | } 412 | 413 | 414 | .src { 415 | background: #f0f0f0; 416 | padding: 0.2em 0.5em; 417 | } 418 | 419 | .keyword { font-weight: normal; } 420 | .def { font-weight: bold; } 421 | 422 | @media print { 423 | #footer { display: none; } 424 | } 425 | 426 | /* @end */ 427 | 428 | /* @group Page Structure */ 429 | 430 | #content { 431 | margin: 0 auto; 432 | padding: 0 2em 6em; 433 | } 434 | 435 | #package-header { 436 | background: rgb(41,56,69); 437 | border-top: 5px solid rgb(78,98,114); 438 | color: #ddd; 439 | padding: 0.2em; 440 | position: relative; 441 | text-align: left; 442 | } 443 | 444 | #package-header .caption { 445 | background: url(hslogo-16.png) no-repeat 0em; 446 | color: white; 447 | margin: 0 2em; 448 | font-weight: normal; 449 | font-style: normal; 450 | padding-left: 2em; 451 | } 452 | 453 | #package-header a:link, #package-header a:visited { color: white; } 454 | #package-header a:hover { background: rgb(78,98,114); } 455 | 456 | #module-header .caption { 457 | color: rgb(78,98,114); 458 | font-weight: bold; 459 | border-bottom: 1px solid #ddd; 460 | } 461 | 462 | 463 | div#style-menu-holder { 464 | position: relative; 465 | z-index: 2; 466 | display: inline; 467 | } 468 | 469 | #style-menu { 470 | position: absolute; 471 | z-index: 1; 472 | overflow: visible; 473 | background: #374c5e; 474 | margin: 0; 475 | text-align: center; 476 | right: 0; 477 | padding: 0; 478 | top: 1.25em; 479 | } 480 | 481 | #style-menu li { 482 | display: list-item; 483 | border-style: none; 484 | margin: 0; 485 | padding: 0; 486 | color: #000; 487 | list-style-type: none; 488 | } 489 | 490 | #style-menu li + li { 491 | border-top: 1px solid #919191; 492 | } 493 | 494 | #style-menu a { 495 | width: 6em; 496 | padding: 3px; 497 | display: block; 498 | } 499 | 500 | #footer { 501 | background: #ddd; 502 | border-top: 1px solid #aaa; 503 | padding: 0.5em 0; 504 | color: #666; 505 | text-align: center; 506 | position: absolute; 507 | bottom: 0; 508 | width: 100%; 509 | height: 3em; 510 | } 511 | 512 | /* @end */ 513 | 514 | /* @group Front Matter */ 515 | 516 | #table-of-contents { 517 | float: right; 518 | clear: right; 519 | background: #faf9dc; 520 | border: 1px solid #d8d7ad; 521 | padding: 0.5em 1em; 522 | max-width: 20em; 523 | margin: 0.5em 0 1em 1em; 524 | } 525 | 526 | #table-of-contents .caption { 527 | text-align: center; 528 | margin: 0; 529 | } 530 | 531 | #table-of-contents ul { 532 | list-style: none; 533 | margin: 0; 534 | } 535 | 536 | #table-of-contents ul ul { 537 | margin-left: 2em; 538 | } 539 | 540 | #description .caption { 541 | display: none; 542 | } 543 | 544 | #synopsis { 545 | display: none; 546 | } 547 | 548 | .no-frame #synopsis { 549 | display: block; 550 | position: fixed; 551 | right: 0; 552 | height: 80%; 553 | top: 10%; 554 | padding: 0; 555 | max-width: 75%; 556 | } 557 | 558 | #synopsis .caption { 559 | float: left; 560 | width: 29px; 561 | color: rgba(255,255,255,0); 562 | height: 110px; 563 | margin: 0; 564 | font-size: 1px; 565 | padding: 0; 566 | } 567 | 568 | #synopsis p.caption.collapser { 569 | background: url(synopsis.png) no-repeat -64px -8px; 570 | } 571 | 572 | #synopsis p.caption.expander { 573 | background: url(synopsis.png) no-repeat 0px -8px; 574 | } 575 | 576 | #synopsis ul { 577 | height: 100%; 578 | overflow: auto; 579 | padding: 0.5em; 580 | margin: 0; 581 | } 582 | 583 | #synopsis ul ul { 584 | overflow: hidden; 585 | } 586 | 587 | #synopsis ul, 588 | #synopsis ul li.src { 589 | background-color: #faf9dc; 590 | white-space: nowrap; 591 | list-style: none; 592 | margin-left: 0; 593 | } 594 | 595 | /* @end */ 596 | 597 | /* @group Main Content */ 598 | 599 | 600 | .clearfix:after { 601 | clear: both; 602 | content: " "; 603 | display: block; 604 | height: 0; 605 | visibility: hidden; 606 | } 607 | 608 | .subs ul { 609 | list-style: none; 610 | display: table; 611 | margin: 0; 612 | } 613 | 614 | .subs ul li { 615 | display: table-row; 616 | } 617 | 618 | .subs ul li dfn { 619 | display: table-cell; 620 | font-style: normal; 621 | font-weight: bold; 622 | margin: 1px 0; 623 | white-space: nowrap; 624 | } 625 | 626 | .subs ul li > .doc { 627 | display: table-cell; 628 | padding-left: 0.5em; 629 | margin-bottom: 0.5em; 630 | } 631 | 632 | .subs ul li > .doc p { 633 | margin: 0; 634 | } 635 | 636 | /* Render short-style data instances */ 637 | .inst ul { 638 | height: 100%; 639 | padding: 0.5em; 640 | margin: 0; 641 | } 642 | 643 | .inst, .inst li { 644 | list-style: none; 645 | margin-left: 1em; 646 | } 647 | 648 | /* Workaround for bug in Firefox (issue #384) */ 649 | .inst-left { 650 | float: left; 651 | } 652 | 653 | .top p.src { 654 | border-top: 1px solid #ccc; 655 | } 656 | 657 | .subs, .doc { 658 | /* use this selector for one level of indent */ 659 | padding-left: 2em; 660 | } 661 | 662 | .warning { 663 | color: red; 664 | } 665 | 666 | .arguments { 667 | margin-top: -0.4em; 668 | } 669 | .arguments .caption { 670 | display: none; 671 | } 672 | 673 | .fields { padding-left: 1em; } 674 | 675 | .fields .caption { display: none; } 676 | 677 | .fields p { margin: 0 0; } 678 | 679 | /* this seems bulky to me 680 | .methods, .constructors { 681 | background: #f8f8f8; 682 | border: 1px solid #eee; 683 | } 684 | */ 685 | 686 | /* @end */ 687 | 688 | /* @group Auxillary Pages */ 689 | 690 | 691 | .extension-list { 692 | list-style-type: none; 693 | margin-left: 0; 694 | } 695 | 696 | 697 | 698 | #index .caption, 699 | #module-list .caption { font-size: 131%; /* 17pt */ } 700 | 701 | #index table { 702 | margin-left: 10em; 703 | border-collapse:collapse; 704 | border-spacing:0 705 | } 706 | 707 | #index .src { 708 | font-weight: bold; 709 | } 710 | #index .alt { 711 | font-size: 77%; /* 10pt */ 712 | font-style: italic; 713 | padding-left: 2em; 714 | } 715 | 716 | #index td + td { 717 | padding-left: 1em; 718 | } 719 | 720 | 721 | .highlight code { 722 | background:#000 723 | } 724 | 725 | -------------------------------------------------------------------------------- /sandbox/wiki/theme/style.org: -------------------------------------------------------------------------------- 1 | #+HTML_HEAD: 2 | #+HTML_HEAD: 3 | --------------------------------------------------------------------------------