[dbdoclet] Re: problem with <p>@see</p>]

Hello Mirek,

I think dbdoclet should not generate invalid DocBook code, even if you are 
using a wrong markup. The closing tag </p> is part of @see comment, but the 
opening tag <p> is not. The opening tag <p> is already interpreted as single 
paragraph without a closing tag. But the closing tag </p> should be converted 
to text and would look like &lt;/p&gt;. That's only a half solution for you, 
but I think it's the best one. You should also start to fix the comments.

Perhaps you can use GNU Emacs to search for all @see Tags and remove the 
surounding <p> tags automatically. Write a little lisp macro and start it in 
batch mode for every source file. I've done this for weaving log4j statements 
into my Java classes. I append the lisp code of my function to this mail.

I try to fix and release this stuff tomorrow as release 0.45. Release 0.44 is 
already on my server but not yet announced. So 0.44 will be skipped.

Regards
  Michael 

(defun weaver-log4j()
  (interactive)
  (message "[weaver-log4j]: Weaving log4 code...")
  (message "[weaver-log4j]: Jump to the beginning of the buffer...")
  (beginning-of-buffer)
  (if (re-search-forward "^\\s-*import\\s-+org\.apache\.log4j\.Logger" nil t)
      (message "[weaver-log4j]: Logger is already imported.")
    (progn
      (message "[weaver-log4j]: Searching for import statements...")
      (end-of-buffer)
      (if (not (re-search-backward "^\\s-*import" nil t))
          (let ()
            (re-search-backward "^\\s-*package" nil t)
            (end-of-line)
            (open-line 1)
            (forward-line)
            (beginning-of-line)
            ))
      
      (message "[weaver-log4j]: Importing Logger.")
      (end-of-line)
      (open-line 1)
      (forward-line)
      (beginning-of-line)
      (insert-string "import org.apache.log4j.Logger;")))
  
  (message "[weaver-log4j]: Jump to the beginning of the buffer...")
  (beginning-of-buffer)
  (message "[weaver-log4j]: Searching for Logger.getLogger call...")
  (if (not (re-search-forward "Logger logger = Logger.getLogger" nil t))
      (progn
        (if (not (re-search-forward 
"^\\s-*\\(abstract\\)?\\s-*\\(public\\|protected\\|private\\)?\\s-*\\(final\\)?\\s-*class\\s-*\\(\\w+\\)"
 
nil t))
            (message "[weaver-log4j]: Can't find class statement")
          (progn
            (setq class-name (match-string 4))
            (message (concat "[weaver-log4j]: Found class " class-name))
            (if (search-forward "{" nil t) 
                (progn
                  (message (concat "[weaver-log4j]: Writing code for class " 
class-name))
                  (end-of-line)
                  (open-line 1)
                  (forward-line)
                  (beginning-of-line)
                  (push-mark)
                  (insert-string "/**\n")
                  (insert-string " * The variable <code>logger</code>{@link 
org.apache.log4j.Logger (org.apache.log4j.Logger)}\n")
                  (insert-string " * can be used to print logging information 
via the log4j 
framework.\n")
                  (insert-string " */\n")
                  (insert-string (concat "private static Logger logger = 
Logger.getLogger(" 
class-name ".class);\n"))
                  (indent-region (mark) (point) nil)))))))
  (jde-import-organize)
  (jde-import-kill-extra-imports))



Other related posts: