Skip to content

Commit 2b55bc5

Browse files
committed
option --note-html
git-svn-id: https://www.lri.fr/svn/demons/bibtex2html/trunk@435 6aee9057-109c-4a6d-8c93-4c3f535006fd
1 parent e722f4d commit 2b55bc5

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
o new option --note-html similar to --note but assuming a bibtex
3+
field already in HTML format
24
o various little changes in the Makefile requested by the Debian maintainer
35

46
Version 1.95, March 23, 2010

main.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,10 @@ i*)
460460
add_note_field s; parse_rec rem
461461
| ("-note" | "--note") :: [] ->
462462
usage()
463+
| ("-note-html" | "--note-html") :: s :: rem ->
464+
add_note_html_field s; parse_rec rem
465+
| ("-note-html" | "--note-html") :: [] ->
466+
usage()
463467
| ("-ln" | "-labelname" | "--labelname" | "--label-name") :: rem ->
464468
use_label_name := true; parse_rec rem
465469
| ("-multiple" | "--multiple") :: rem ->

translate.ml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ let title_url = ref false
4646
let use_label_name = ref false
4747
let use_keys = ref false
4848
let linebreak = ref false
49-
let note_fields = ref ([] : string list)
49+
type note_kind = NKlatex | NKhtml
50+
let note_fields = ref ([] : (string * note_kind) list)
5051
let abstract_name = ref "Abstract"
5152
let doi = ref true
5253
let doi_prefix = ref "http://dx.doi.org/"
@@ -81,7 +82,11 @@ let add_named_field s name =
8182

8283
let add_note_field s =
8384
let u = String.lowercase s in
84-
note_fields := !note_fields @ [u]
85+
note_fields := !note_fields @ [u, NKlatex]
86+
87+
let add_note_html_field s =
88+
let u = String.lowercase s in
89+
note_fields := !note_fields @ [u, NKhtml]
8590

8691
(* first pass to get the crossrefs *)
8792

@@ -289,11 +294,12 @@ let display_abstract ch a = blockquote ch (fun () -> latex2html ch a)
289294

290295
let display_notes ch e =
291296
List.iter
292-
(fun f ->
297+
(fun (f, k) ->
293298
try
294299
let a = Expand.get_lowercase_field e f in
295-
display_abstract ch a;
296-
(* JK Html.paragraph ch *)
300+
match k with
301+
| NKlatex -> display_abstract ch a (* JK Html.paragraph ch *)
302+
| NKhtml -> output_string ch a
297303
with Not_found -> ())
298304
!note_fields
299305

translate.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ val table : table_kind ref
5858
val add_field : string -> unit
5959
val add_named_field : string -> string -> unit
6060
val add_note_field : string -> unit
61+
val add_note_html_field : string -> unit
6162

6263
(*s Production of the HTML output. *)
6364

0 commit comments

Comments
 (0)