[O] accessing ATTR_HTML and CAPTION from custom

2018-03-09 Thread Seong-Kook Shin

Hello,

I'm using Nikola (https://getnikola.com/) with its orgmode plugin to 
write blog posts.  Their script contains following custom link for HTML 
export:


(defun org-custom-link-img-url-export (path desc format)
  (cond
   ((eq format 'html)
(format "" path desc
(org-add-link-type "img-url" nil 'org-custom-link-img-url-export)


And I have org-mode contents like this:

#+CAPTION: some caption for the image
#+ATTR_HTML: width="60%"
[[img-url:/img/a.jpg]]

I found that somehow DESC parameter passed to above 
org-custom-link-img-url-export function contains all information 
regarding CAPTION and ATTR_HTML but unable to retrieve it properly.  Is 
there any org utility functions to retrieve them?  For example, I want 
to access 'width' parameter from ATTR_HTML like this:


(defun org-custom-link-img-url-export (path desc format)
  (cond
   ((eq format 'html)
(let ((width (SOME-FUNCTION desc :width)))
  (if (null width)
  (format "" ... width)
(format "" ...))

Could you help me how to do that?

Thank you.



Re: [O] How to force markup without spaces

2012-11-19 Thread Seong-Kook Shin
Yes, thank for the solution.

By the way, I'll prefer word joiner character (U+2060) to zero width
space character (U+200B),
because postpositions (grammar) should not be separated on line-break
policy.

Anyway, is there any plan to implement this feature in other way?
Using the solution that you provides makes the org document stick to the
unicode,
so it can't be used in other character encodings.

Thanks.

On Mon, Nov 19, 2012 at 4:11 PM, Vladimir Lomov lomov...@gmail.com wrote:

 Hello,
 ** cin...@gmail.com [2012-11-19 14:32:21 +0900]:

  Hi,

  AFAIK, if the markup syntax (=code=, *bold*, ..) is directly followed
  by non-whitespace characters, then it will not be marked-up:

 =hello=there
 /not/italic

  This may be right decision on English text, but in some languages, the
  postposition (grammar) will be postfixed without spaces into the
  previous noun, so it will be the trouble.  (Following text contains
  Korean characters in UTF-8, you may need additional korean font to
  read properly)

 =printf=는
 =bold=로
 =철수=는

  I'm sure that some other languages will have same problem
  (e.g. Japanese or Chinese).

  Is there any way to force mark-up on this situation?

  If this pattern cannot be implemented easily, how about to introduce
  new escaping character to prevent to insert whitespace between
  marked-up text and the following postfix text?  For example:

=printf=\is  = rendered in HTML: codeprintf/codeis
*bold*\asdf  = rendered in HTML: bbold/basdf
/철수/\는= rendered in HTML: i철수/i는

  I can't say the above solution is well-designed, but I'm sure that
  you'll get the point.

 May be this will help you:
 http://article.gmane.org/gmane.emacs.orgmode/46263/match=zero+width+space

 --
 Had he and I but met
 By some old ancient inn,But ranged as infantry,
 We should have sat us down to wet   And staring face to face,
 Right many a nipperkin! I shot at him as he at me,
 And killed him in his place.
 I shot him dead because --
 Because he was my foe,  He thought he'd 'list, perhaps,
 Just so: my foe of course he was;   Off-hand-like -- just as I --
 That's clear enough; although   Was out of work -- had sold his
 traps
 No other reason why.
 Yes; quaint and curious war is!
 You shoot a fellow down
 You'd treat, if met where any bar is
 Or help to half-a-crown.
 -- Thomas Hardy




-- 
C FAQs: http://c-faq.com/
Korean: http://www.cinsk.org/cfaqs/


[O] confirmed: org-mode works with yasnippets 0.8.0 (beta)

2012-11-18 Thread Seong-Kook Shin
Hi,

I just want to let you know that org-mode (org-20121112 from package.el) is
working well with yasnippets 0.8.0 (beta)
with following configuration:

(defun yas-org-very-safe-expand ()
  (let ((yas-fallback-behavior 'return-nil))
(and (fboundp 'yas-expand) (yas-expand

(add-hook 'org-mode-hook
  (lambda ()
(add-to-list 'org-tab-first-hook
 'yas-org-very-safe-expand)
))

You may update the documentation with the above settings.
(Note that this does not works with the old version of yasnippets)

Thanks.

-- 
C FAQs: http://c-faq.com/
Korean: http://www.cinsk.org/cfaqs/