 (defun org-wiki/asset-insert ()
   "Insert link to asset file of current page at current point."
   (interactive)
+  
   (org-wiki/asset-helm-selection
 
    (file-name-base (buffer-file-name))

(setq org-wiki/index-file-basename "Index")

;; ------- Internal functions ------------ ;; 

(defun org-wiki/concat-path (base relpath)
  
  "Concat directory path and a relative path"

  (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")

