@ -3,7 +3,7 @@
;; Author: Plum <boku@plum.moe>
;; Author: Plum <boku@plum.moe>
;; Created: June 2020
;; Created: June 2020
;; Package-Version: 1.2. 0
;; Package-Version: 1.2. 1
;; Keywords: files
;; Keywords: files
;; URL: https://words.plum.moe/ox-plumhtml.html
;; URL: https://words.plum.moe/ox-plumhtml.html
;; Package-Requires: ((emacs "26.1") (ox-slimhtml "0.4.5"))
;; Package-Requires: ((emacs "26.1") (ox-slimhtml "0.4.5"))
@ -120,20 +120,18 @@ INFO is a plist holding contextual information."
( cond
( cond
( ( ox-slimhtml--immediate-child-of-p link 'link )
( ( ox-slimhtml--immediate-child-of-p link 'link )
( org-element-property :raw-link link ) )
( org-element-property :raw-link link ) )
( ( not contents )
( format " <em>%s</em> " ( org-element-property :path link ) ) )
( t ( let ( ( link-type ( org-element-property :type link ) )
( t ( let ( ( link-type ( org-element-property :type link ) )
( href ( org-element-property :raw-link link ) )
( href ( org-element-property :raw-link link ) )
( attributes ( if ( ox-slimhtml--immediate-child-of-p link 'paragraph )
( attributes ( if ( ox-slimhtml--immediate-child-of-p link 'paragraph )
( ox-slimhtml--attr ( org-export-get-parent link ) )
( ox-slimhtml--attr ( org-export-get-parent link ) )
" " ) )
" " ) )
( element " <a href= \" %s \" %s>%s</a> " ) )
( element " <a href= \" %s \" %s>%s</a> " )
( path ( or ( org-element-property :path link ) " " ) ) )
( cond
( cond
( ( string= " file " link-type )
( ( string= " file " link-type )
( let ( ( html-extension ( or ( plist-get info :html-extension ) " " ) )
( let ( ( html-extension ( or ( plist-get info :html-extension ) " " ) )
( use-abs-url ( plist-get info :html-link-use-abs-url ) )
( use-abs-url ( plist-get info :html-link-use-abs-url ) )
( link-org-files-as-html ( plist-get info :html-link-org-as-html ) )
( link-org-files-as-html ( plist-get info :html-link-org-as-html ) ) )
( path ( or ( org-element-property :path link ) " " ) ) )
( format element
( format element
( concat ( if ( and use-abs-url ( file-name-absolute-p path ) ) " file: " " " )
( concat ( if ( and use-abs-url ( file-name-absolute-p path ) ) " file: " " " )
( if ( and link-org-files-as-html ( string= " org " ( downcase ( or ( file-name-extension path ) " " ) ) ) )
( if ( and link-org-files-as-html ( string= " org " ( downcase ( or ( file-name-extension path ) " " ) ) ) )
@ -142,12 +140,15 @@ INFO is a plist holding contextual information."
( file-name-sans-extension path ) )
( file-name-sans-extension path ) )
path ) )
path ) )
attributes contents ) ) )
attributes contents ) ) )
( ( and ( string= " fuzzy " link-type )
( not contents ) )
( format " <em>%s</em> " path ) )
( ( and ( string= " fuzzy " link-type )
( ( and ( string= " fuzzy " link-type )
( plist-get info :export-header-ids ) )
( plist-get info :export-header-ids ) )
( format " <a href= \" #%s \" %s>%s</a> "
( format " <a href= \" #%s \" %s>%s</a> "
( org-export-get-reference ( org-export-resolve-fuzzy-link link info ) info )
( org-export-get-reference ( org-export-resolve-fuzzy-link link info ) info )
attributes contents ) )
attributes contents ) )
( t ( format element href attributes contents ) ) ) ) ) ) )
( t ( format element href attributes ( or contents href ) ) ) ) ) ) ) )
;; org-export backend and export/publish functions
;; org-export backend and export/publish functions
( org-export-define-derived-backend 'plumhtml
( org-export-define-derived-backend 'plumhtml