Skip to content

Latest commit

 

History

History
252 lines (167 loc) · 6.18 KB

Development-Notes.org

File metadata and controls

252 lines (167 loc) · 6.18 KB

Development Notes

Development Notes

Tasklist

  • Document the API for developers and Add development Notes
  • Organize the API building a better abstraction and eliminating repeated code.
  • Add code exaples with IELM output and show how it works.
  • Add backend to extract metadata.
    • Goals:
      • Build a small database that allows the user to search metadata in a fast way.
      • Search pages by title
      • Search pages by tags
      • Search pages by tags and titles
    • Requirements:
      • Self contained script language
      • Small and easy to install and easy to distribute as an self-contained executable.
      • Fast startup time
      • Support to sqlite
      • Better candidate seems to be Python or Racket-scheme
  • Add automatic header creation.
  • Update GIFs
  • Add clip.jar utility as a GIT submodule
  • Create a dired or magit-like interface to browse the notes.

API Diagram

 Current Buffer
 ---------------------------
                              
                   +-------> org-wiki-buffer-is-page-p 
                  /           Test if current buffer is a org-wiki page
                 /
 +--------------+----------> org-wiki-buffer-pagename 
 |              |              Get page name of current buffer 
 |   Current    +
 |    Buffer    |----------> org-wiki-buffer-directory 
 |              |            Get asset/attachment directory of a org-wiki buffer 
 +--------------+



 Operations with org-wiki buffers
 --------------------------------

 +---------------------+------------> Close all org-wiki buffers and saving them.
 |  org-wiki-buffers   |
 |                     +------------> Return all buffers belonging to org-wiki 
 |                     |
 +---------+-----------+------------> Switch between org-wiki buffers



 Operations with org-wiki files 
 -------------------------------


+-------------------------------+--------> Get all org-wiki file names        
|                               |
|                               |
| org-wiki files in             +--------> Open org-wiki page (org-mode file) in 
| <org-wiki-location directory  |           - current window 
|                               |           - new window 
+-------------------------------+           - new frame

Functions and Variables Documentation

Variables

org-wiki-location - Org-wiki storage directory

  • org-wiki-location - Contains the org-wiki-storage directory. This variable can be set by the user.

Example:

ELISP> org-wiki-location
"~/Documents/wiki"
ELISP> 

Functions

Name transformation

org-wiki–page-list - Get all org-wiki pages

  • org-wiki–page-list()

Show all org-wiki-pages. Example:

ELISP> (org-wiki--page-list)

("Accounting" "Bash_Script" "Binary_Files_and_Econding" "Bookmark2"
 "Bookmarks" "Brazil_Income_Tax" "Business" "C_and_Cplus"
 "CalculosTrabalhistas" "Carros_Automoveis" "CatRepelent" "Cint_Root"
 ...)

org-wiki–page->file - Convert page name to file

  • org-wiki–page->file (pagename)

Transforms a wiki page name into the corresponding file name.

Example:

ELISP> (org-wiki--page->file "Smalltalk programming")
"~/Documents/wiki/Smalltalk programming.org"
ELISP> 

org-wiki–file->page - Convert file to page name

  • org-wiki–file->page (filename)

Transforms the org-wiki file name into the corresponding page name.

ELISP> (org-wiki--file->page (org-wiki--page->file "Smalltalk programming"))
"Smalltalk programming"
ELISP> 

Current Page

org-wiki–current-page - Get the page name of current org-wiki buffer

  • org-wiki–current-page()

Example:

ELISP> (buffer-file-name)
"/home/archbox/Documents/wiki/Smalltalk programming.org"
ELISP> 

ELISP> (org-wiki--current-page)
"Smalltalk programming"
ELISP> 

org-wiki–current-page-asset-file - Get path to current page’s asset file.

Example:

ELISP> (current-buffer)
#<buffer Smalltalk programming.org>

ELISP> (org-wiki--current-page)
"Smalltalk programming"
ELISP> 

ELISP> (buffer-file-name)
"/home/archbox/Documents/wiki/Smalltalk programming.org"

ELISP> (org-wiki--current-page-asset-file "numerical-methods-in-smalltalk.pdf")
"Smalltalk programming/numerical-methods-in-smalltalk.pdf"
ELISP> 

Asset files / Attachment files

org-wiki–assets-get-dir - Get page’s asset directory

  • org-wiki–assets-get-dir (pagename)

Example: Get the Linux page’s (file: Linux.org) asset directory.

ELISP> (org-wiki--assets-get-dir "Linux")
"~/Documents/wiki/Linux"
ELISP> 

Example: Open this directory:

ELISP> (dired  (org-wiki--assets-get-dir "Linux"))

org-wiki–asset-page-files - Get all asset files belonging to a page.

Example:

ELISP> (org-wiki--current-page)
"Smalltalk programming"

ELISP> (buffer-file-name)
"/home/archbox/Documents/wiki/Smalltalk programming.org"
ELISP> 

ELISP> (org-wiki--asset-page-files "Smalltalk programming")
("." ".." "extendingClasses-number1.gst" "gst.im" "numerical-methods-in-smalltalk.pdf" "smalltak1.st")

org-wiki–current-page-asset-dir - Get curren page’s asset directory

Example:

ELISP> org-wiki-location 
"~/Documents/wiki"
ELISP> 

ELISP> (buffer-file-name)
"/home/archbox/Documents/wiki/Smalltalk programming.org"

ELISP> (org-wiki--current-page)
"Smalltalk programming"

ELISP> (org-wiki--current-page-asset-dir)
"~/Documents/wiki/Smalltalk programming"

Non categorized

org-wiki-xdg-open - Open a file with default system app.

  • org-wiki-xdg-open (filename)

Example: It will open the file manual.pdf with whatever PDF viewer is installed in the system such as Adobe Acrobat Reader or Foxit Reader.

ELISP> (org-wiki-xdg-open "Linux/manual.pdf")