emacs-orgmode
[Top][All Lists]
Advanced

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

[O] syntax bugs in footnotes


From: Samuel Wales
Subject: [O] syntax bugs in footnotes
Date: Thu, 28 Apr 2011 15:55:57 -0700

Latest git, Emacs 22, my blog exporter settings to HTML, which are
enclosed.  The bugs will probably work with default export.

Bug 1: commented incomplete footnote interacts with link in
later text.  Result is that comments get exported.  IMO
comments should be absolute except in the case of #+ lines.

# [fn::I will call this the status quo effect for lack of an
# existing term.  It isn't a true bias like status quo

see this.  see [[this link][this link]].  and see this too.

Bug 2: partial exporting of inline footnote after an inline
footnote.[fn::watch][fn::this]

Bug 3: closing bracket in a link closes footnote.[fn::Try
exporting [[http://google.com][google]] this.]

===

(defconst alpha-org-blog-html-buffer "alpha-org-blog.html")
;;(defconst alpha-org-wc-buffer "*alpha-org-wc*")
(defun alpha-org-blog-subtree ()
  "Copy the subtree, converted to HTML, for pasting into Blogger
as a blog post.

If there is an active region, use that instead.

No other software needs to be installed.  No temporary file is
created.

For an example of this code in action, see
http://thekafkapandemic.blogspot.com/ .

===

You have to turn off Blogger's conversion of newline to br tags
in two places in settings.  This requires the new Blogger post
editor.

The HTML code is left in a buffer.  To display it in a browser,
use M-x browse-url-of-buffer or similar.

mail2blogger is a very intriguing option here and I'd like to do
that.  Avoids the web entirely.  See comments.

===

The top level headline is not interpreted with Blogger title
semantics.  By default it is not exported at all, because Blogger
already has a title.  For both posts and pages, Blogger's title
field forms the URL and is therefore manually entered.

===

Advanced:

You can export the top level headline with :title:.  For pasting
into Blogger, I don't do this, because it shows up with what
looks like two titles.  In the future, we can make it work with
backends like mail2blogger.  Then it will have title
semantics (the top level will become the title).

In Blogger, pages are different from posts.  They are accessed by
tabs like About, Contribute, Contact.

:title: is also useful if you want to try a different strategy.
I did this for my first blog post.  You can change whether to
include title fields in Blogger settings.  You can only do this
for posts.  Turning off titles has one convenience: you don't
have to enter them manually (simply paste).  It also has two
drawbacks: (1) people who link to your post by copying that link
cannot do so (they can get it from other places, including the
URL bar and Archives in the sidebar) and (2) the URL gets formed
a litle funnily.

===

I use Blogger.com for hosted blogging instead of Wordpress.com
because Google has a better attitude toward accessibility.
"
  (interactive)

;;; todo list
;;;
;;; === mail2blogger ===
;;;
;;; I tried using mail2blogger, but the HTML got posted.  There might
;;; be a way to fix this.  How do you do an HTML email in a format
;;; that gets recognized as HTML?
;;;
;;; We want to use raw programmatic email, such as sent using msmtp
;;; or the built-in Emacs client.  The ability to do so will obviate
;;; the need to use Google's command line client or to run Emacs 23.
;;;
;;; Patch welcome.
;;;
;;; ===
;;;
;;; Another good thing to try would be to automate grabbing the source from
;;; the page automatically to compare what you just created with ediff or
;;; git diff --color-words.  This is for edits.
;;;
;;; Also, export whole blog before each post for git.  Requires post
;;; method maybe.  How to do that?
;;;
;;; Also, check for fixmes.  (Or org could check for fixmes before
;;; all export.  Is there a hook?)
;;;
;;; Also, remind you to extract big chunks of comments for possible ohter
;;; blog entries.
;;;
;;; /Also, remind you to make sure all links work and review formatting/.
;;;
;;; ===
;;;
;;; Is there HTML for a title?  I will guess not.

  ;;say about to publish editing or about to publish post.  with
  ;;mail2blogger or weblogger.el or atom, we can automate this and assume
  ;;publish.
  ;;
  ;;technically, this should be later in case you kill something inside the
  ;;note.  for some reason org adds this to the post command hook instead of
  ;;just doing it at the time.  need to get this to just do it.  maybe
  ;;call-interactively will work?  no, that does not fix it.
  ;;
  ;;(let ((k kill-ring))
  ;;(let ((c (car kill-ring)))

  ;;(org-add-note)

  ;;could add sugu here.  donekeep should be done manually.
  (save-excursion
    (save-window-excursion
      ;;i have an issue with "--", which is perfect for emdash in ascii, but
      ;;gets converted to endash in html.  i'd like it to be emdash in html.
      ;;is there an option for that?

      ;;org converts headlines to html h numbers according to the level in the
      ;;org file, not the level in the region.  i prefer the latter.
      ;;
      ;;here we kludge it to do it my way.
      ;;
      ;;top 1 means that the very top level in org is h1 (even if you don't
      ;;export it).  it is large.  the second level in org is h2.
      ;;
      ;;blogger does not format h2 bold on firefox in the watermark
      ;;template.  so h3 looks bigger than h2.  this is probably a failing
      ;;in blogger or watermark css or firefox display.
      ;;
      ;;therefore, we start with h3 or lower level.  if we used the top
      ;;level headline (using the :title: tag), we could start with top 3.
      ;;= h3.
      ;;
      ;;but we don't use the top level headline, so we use top 2 = h2 (the
      ;;one that doesn't work).  thus the second level in org = h3 which is
      ;;just right.
      ;;
      ;;if we tweak the css for h2, we can use any h level we want.  h1 is
      ;;enormous, but h2 is ok.  so we can do top 1 = h1 and then the second
      ;;level is h2.  or top 2 = h2 if that is too large.
      ;;
      ;;css wizards please weigh in on this.
      ;;
      ;;fixme test top semantics with title
      (let ((top 1))
        (unless (org-region-active-p)
          (outline-mark-subtree))
        (unless (member "title" (org-get-tags))
          ;;remove title
          (forward-line 1)
          ;;might be nice to add hr here
          ;;we will start with the first headilne's title
          ;;(decf top))
          )
        (switch-to-buffer
         (let ((org-export-html-toplevel-hlevel
                (+ top -1 (- org-export-html-toplevel-hlevel
                             (org-reduced-level (org-current-level)))))
               (org-export-headline-levels
                (+ top -1 (- org-export-headline-levels
                             (org-reduced-level (org-current-level)))))
               org-export-with-tags
               org-export-with-todo-keywords
               org-export-with-timestamps
               ;;note: priority must be after todo kw for export
               ;;already nil org-export-with-priority
               )
           (org-export-region-as-html (region-beginning)
                                      (region-end)
                                      t
                                      ;;seems to erase, which we want
                                      (get-buffer-create
                                       ;;this should work if it is a
                                       ;;*buffer* but some might prefer html
                                       ;;mode.  this does not save to a file
                                       ;;unless you do.
                                       alpha-org-blog-html-buffer)))

         ;;one drawback is it leaves spaces around text.  like "tag> text".
         ;;(hoka-unfill-region-special (point-min) (point-max))
         ;;(goto-char (point-min))
         ;;this does not work because it will join lines with no space
in between;
         ;;we have to actually fill paragraphs.
;;;   (while (search-forward "\n" nil t)
;;;     (replace-match ""))
;;;   (insert "\n")
         ;;unnec if blogger knows to treat whitespace as insignificant
;;;   (goto-char (point-min))
;;;   (delete-matching-lines "^$")
         (kill-ring-save (point-min) (point-max))))
      (setq header-line-format "html output")
      ;;return this for programmatic use
      (current-buffer)))
  ;;(setq deactivate-mark t)
  )

Samuel

-- 
The Kafka Pandemic:
  
http://thekafkapandemic.blogspot.com/2010/12/welcome-to-kafka-pandemic-two-forces_9182.html
I support the Whittemore-Peterson Institute (WPI)
===
I want to see the original (pre-hold) Lo et al. 2010 NIH/FDA/Harvard MRV paper.



reply via email to

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