[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Raw Org AST snippets for "impossible" markup

From: Juan Manuel Macías
Subject: Re: Raw Org AST snippets for "impossible" markup
Date: Thu, 09 Dec 2021 22:27:08 +0000

Juan Manuel Macías writes:

> Jumping into the "real world", how about these two examples of nested 
> emphasis?

By the way, what do you think about allowing the use of some kind of
aliases, so that the aspect is less verbose? Maybe something like "(i::"
instead of "(italic () ..."? I came up with this hasty sketch over your
latest code, *just* to see how it looks (I don't know if I prefer it to
stay verbose):

#+begin_src emacs-lisp :results silent
 (setq orgia-alias-alist '(("i" "italic")
                           ("b" "bold")
                           ("u" "underline")
                           ("s" "strike-through")))

  (defun orgia-replace (before after)
      (goto-char (point-min))
      (while (re-search-forward before nil t)
        (replace-match after t nil))))

  (defun orgia--transform-path (path)
      (insert path)
      (mapc (lambda (el)
              (orgia-replace (concat "(" (car el) "::") (concat "(" (cadr el) " 
() ")))

  (defun orgia--transform-link (data)
    (if (not (string-equal "orgia" (org-element-property :type data)))
      (let* ((path (org-element-property :path data)))
        (if (not (eq ?\( (aref path 0)))
            (or path (org-element-contents data))
          (read (orgia--transform-path path)))))) ;; <====

#+begin_src elisp
   (org-export-string-as "An <orgia:(\"in\" (s:: \"ter\"))>word"
'odt t)

: <text:p text:style-name="Text_20_body">An in<text:span 

#+begin_src org :results latex :results replace
  [[orgia:(i:: "The English versions of the " (b:: (i:: "Iliad")) " and the " 
(b:: (i::

#+begin_export latex
\emph{The English versions of the \textbf{\emph{Iliad}} and the 

Juan Manuel Macías 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]