Skip to content

Commit cf2037c

Browse files
authored
Merge pull request #44 from CourseOrchestra/para_before_preamble
Added para before preamble
2 parents 45bacc3 + a433bc6 commit cf2037c

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

lib/a-od-producer/asciidoctor-od.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
$aodp_assume_src_dpi = 130
110110
$aodp_list_first_level_indent = "12.7mm"
111111
$aodp_list_other_levels_indent = "6.4mm"
112+
$aodp_sn_preamble_before_paragraph = "Preamble_20_Before_20_Paragraph"
112113

113114
=begin
114115
tag::algorithm_description[]
@@ -438,6 +439,8 @@ def h_basic_toc_header; BasicTocHeader.new(@sn, @sd) if
438439
!!(@sn =~ /^adoc_toch[ ]/) end
439440
def h_basic_toc_inline_quoted; BasicTocInlineQuoted.new(@sn, @sd) if
440441
!!(@sn =~ /^adoc_tociq[ ]/) end
442+
def h_basic_preamble_first_paragraph; BasicPreambleFirstParagraph.new(@sn, @sd) if
443+
!!(@sn =~ /^adoc_pr[ ]/) end
441444
end
442445

443446

@@ -786,7 +789,7 @@ def h_parent_style_name
786789
def h_style_vertical_pos
787790
@sd["style:graphic-properties"]["style:vertical-pos"] = "top"
788791
@sd["style:graphic-properties"]["style:vertical-rel"] = "baseline"
789-
@sd["style:graphic-properties"]["text:anchor-type"] = "paragraph"
792+
@sd["style:graphic-properties"]["text:anchor-type"] = "paragraph"
790793
@sd["style:graphic-properties"]["style:flow-with-text"] = "true"
791794
@sd["style:graphic-properties"]["style:wrap"] = "none"
792795
end
@@ -906,6 +909,14 @@ def h_parent_style_name
906909
@sd[:parent_style_name] = $aodp_sn_toc_dots_space_page_number if !!(@snr =~ / dots_space_page_number /)
907910
end
908911
end
912+
913+
914+
class BasicPreambleFirstParagraph < BasicHelper
915+
def h_parent_style_name
916+
@sd[:parent_style_name] = $aodp_sn_preamble_before_paragraph if !!(@snr =~ / before-paragraph /)
917+
end
918+
end
919+
909920
class StyleToXml
910921
def self.to_doc style_rep, xml_node
911922
style_rep.each do |sn, sd|
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:0a161c51e69737b969e0e671eb42c4826c797ee5c65b04a59ba3185c83ccab81
3-
size 342230
2+
oid sha256:56bd512b7cf58f5108ce32f019b4baf83d7035271c5ed6c4fd75663c328c9b1f
3+
size 342439

lib/slim/preamble.fodt.slim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
text:p text:style-name="adoc_pr before-paragraph "
12
=content

test/test_cases/stew/test.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
1313
:base64-image-example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==
1414
15-
{nbsp}
1615
1716
Some sort of [((preamble))]
1817
multiline paragraph.

0 commit comments

Comments
 (0)