 
 
 (defun org-wiki--page->file (pagename)
-  "Get the corresponding wiki file (*.org) to the wiki page name.
-
-  Example: 
-
-  ELISP> (org-wiki--page->file \"Linux\")
-  \"~/org/wiki/Linux.org\"
-
-  "
+  "Get the corresponding wiki file (*.org) to the wiki PAGENAME.
+Example:
+
+ELISP> (org-wiki--page->file \"Linux\")
+  \"~/org/wiki/Linux.org\""
 
   (concat (file-name-as-directory org-wiki-location)
           pagename



(defun org-wiki--assets-get-dir (pagename)
  "Get a path to file in the asset directory"  
  (org-wiki--concat-path org-wiki-location pagename))


(defun org-wiki--assets-make-dir (pagename)
  "Creates the asset directory if it doesn't exist.

  Example: (org-wiki--assets-make-dir \"Bash\") 

  will crate the directory ~/wiki-location/Bash/
  corresponding to the file ~/wiki-location/Bash.org
  If it doesn't exist yet. 
  "
  (let ((assets-dir (org-wiki--assets-get-dir pagename)))

    (if (not (file-exists-p assets-dir))

    ))

(defun org-wiki--asset-page-files (pagename)
  "Get all asset files from a given PAGENAME."
  (org-wiki--assets-make-dir pagename)
  (directory-files (org-wiki--assets-get-dir pagename)))


(defun org-wiki--asset-helm-selection (pagename callback)
  "Higher order function to deal with page assets.
   
org-wiki-asset-helm-selection (pagename callback)

This function opens a helm menu to select a wiki page and then
passes the result of selection to a callback function that takes
a asset file as argument.
  
Example: If the user selects the file freebsdref1.pdf it inserts the
file name at current point.

> (org-wiki--asset-helm-selection \"Linux\" (lambda (file) (insert file)))
  freebsdref1.pdf"
  
  (helm :sources `((
                      (name . "Wiki Pages")

                      (candidates . ,(org-wiki--asset-page-files pagename))

                      (action . ,callback)
                      ))))



(defun org-wiki-asset-insert ()
  "Insert link wiki-asset-sys:<page>;<file> to an asset file of current page..

It inserts a link of type wiki-asset-sys:<Wiki-page>;<Asset-File>
Example:  [[wiki-asset-sys:Linux;LinuxManual.pdf]]"
  (interactive)
  
  (org-wiki--asset-helm-selection
