cortav  Check-in [4409bfef8b]

Overview
Comment:idr fam im tired
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 4409bfef8bebd4a655a50e1ca2fb7fdceb1b538dad9b6f0580ddc44dc110c2d1
User & Date: lexi on 2022-12-14 10:22:18
Other Links: manifest | tags
Context
2023-01-29
20:30
fix css check-in: cf42cc180c user: lexi tags: trunk
2022-12-14
10:22
idr fam im tired check-in: 4409bfef8b user: lexi tags: trunk
09:40
add namespace/source commentary sections; get scope directives working check-in: b5a3802b71 user: lexi tags: trunk
Changes

Modified cortav.ct from [e74ca97d6f] to [996aa283a7].

557
558
559
560
561
562
563
564
565









566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
you should always give your styles semantic names where practicable, instead of simply describing their graphical characteristics. this is good practice in general, but especially because your document will be renderable to different formats with different characteristics, and what makes text look important on a manpage in the terminal may be quite different from how it looks in a webpage or PDF.

##dir directives
	d: [`%[*[##1]]]
	dd: [`%[*[##1]] [#2]]
* {d author} encodes document authorship. multiple author directives can be issued to add additional coauthors
* {d cols} specifies the number of columns the next object should be rendered with
* {d include} transcludes another file
* {d import} reads in the contents of another file as an embeddable section









* {d quote} transcludes another file, without expanding the text except for paragraphs 
* {d embed}, where possible, embeds another file as an object within the current one. in HTML this could be accomplished with e.g. an iframe.
* {d expand} causes the next object (usually a code block) to be fully expanded when it would otherwise not be
* {d font} controls the font stack, for outputs that support changing fonts. see [>fonts fonts] for more information.
* {d lang} changes the current language, which is used by extensions to e.g. control typographical conventions, and may be encoded into the output by certain renderers (e.g. HTML). note that quotes and blockquotes can be set to a separate language with a simpler syntax. the language should be notated using IETF language tags
** {d lang is x-ranuir-Cent-CR8} sets the current language to Ranuir as spoken in the Central Worlds, written in Corran and encoded using C6B+U8L (which can also be interpreted as UTF-8, albeit with some lost semantics). this might be used at the top of a document to set its primary language.
** {d lang push gsw-u-sd-chzh} temporarily switches to Zürich German, e.g. to quote a German passage in an otherwise Ranuir document
** {d lang sec en-US} switches to American English for the duration of a section. does not affect the language stack.
** {d lang pop} drops the current language off the language stack, returning to whatever was pushed or set before it. this would be used, for instance, at the end of a passage
* {d pragma} supplies semantic data about author intent, the kind of information the document contains and hints about how it should be displayed to the user. think of them like offhand remarks to the renderer -- there's no guarantee that it'll pay any attention, but if it does, your document will look better. pragmas have no scope; they affect the entire document. the pragma function exists primarily as a means to allow parameters that would normally need to be specified on e.g. the command line to be encoded in the document instead in a way that multiple implementations can understand. a few standard pragmas are defined.
** {d pragma layout} gives a hint on how the document should be layed out. the first hint that is understood will be applied; all others will be discarded. standard hints include:
*** [`essay]
*** [`narrative]
*** [`screenplay]: uses asides to denote actions, quotes for dialogue
*** [`stageplay]: uses asides to denote actions, quotes for dialogue







|
|
>
>
>
>
>
>
>
>
>

<



|
|
|







557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575

576
577
578
579
580
581
582
583
584
585
586
587
588
you should always give your styles semantic names where practicable, instead of simply describing their graphical characteristics. this is good practice in general, but especially because your document will be renderable to different formats with different characteristics, and what makes text look important on a manpage in the terminal may be quite different from how it looks in a webpage or PDF.

##dir directives
	d: [`%[*[##1]]]
	dd: [`%[*[##1]] [#2]]
* {d author} encodes document authorship. multiple author directives can be issued to add additional coauthors
* {d cols} specifies the number of columns the next object should be rendered with
* {d include} transcludes another file (but see also [>rsrc])
* {d with} imports symbols from another scope:
** {dd with|[$section]} imports all symbols in [$section]
** {dd with|[$section].[$object]} imports [$object] from [$section]
** {dd with|[$name]=[$section]} creates a local alias [$name] for [$section]
** {dd with|[$name]=[$section].[$object]} imports [$object] from [$section] under the name [$name]
* {d global} exports all symbols in the current section so they can be used unprefixed from any other section
** {dd global|[$section]} exports all symbols in [$section]
** {dd global|[$section].[$object]} exports [$object] from [$section]
** {dd global|[$name]=[$section]} creates a global alias [$name] for [$section]
** {dd global|[$name]=[$section].[$object]} exports [$object] from [$section] under the name [$name]
* {d quote} transcludes another file, without expanding the text except for paragraphs 

* {d expand} causes the next object (usually a code block) to be fully expanded when it would otherwise not be
* {d font} controls the font stack, for outputs that support changing fonts. see [>fonts fonts] for more information.
* {d lang} changes the current language, which is used by extensions to e.g. control typographical conventions, and may be encoded into the output by certain renderers (e.g. HTML). note that quotes and blockquotes can be set to a separate language with a simpler syntax. the language should be notated using IETF language tags
** {dd lang is|x-ranuir-Cent-CR8} sets the current language to Ranuir as spoken in the Central Worlds, written in Corran and encoded using C6B+U8L (which can also be interpreted as UTF-8, albeit with some lost semantics). this might be used at the top of a document to set its primary language.
** {dd lang push|gsw-u-sd-chzh} temporarily switches to Zürich German, e.g. to quote a German passage in an otherwise Ranuir document
** {dd lang sec|en-US} switches to American English for the duration of a section. does not affect the language stack.
** {d lang pop} drops the current language off the language stack, returning to whatever was pushed or set before it. this would be used, for instance, at the end of a passage
* {d pragma} supplies semantic data about author intent, the kind of information the document contains and hints about how it should be displayed to the user. think of them like offhand remarks to the renderer -- there's no guarantee that it'll pay any attention, but if it does, your document will look better. pragmas have no scope; they affect the entire document. the pragma function exists primarily as a means to allow parameters that would normally need to be specified on e.g. the command line to be encoded in the document instead in a way that multiple implementations can understand. a few standard pragmas are defined.
** {d pragma layout} gives a hint on how the document should be layed out. the first hint that is understood will be applied; all others will be discarded. standard hints include:
*** [`essay]
*** [`narrative]
*** [`screenplay]: uses asides to denote actions, quotes for dialogue
*** [`stageplay]: uses asides to denote actions, quotes for dialogue

Modified cortav.lua from [06fed19c69] to [8866cd9ea2].

1757
1758
1759
1760
1761
1762
1763

















	end
	if v.raw then
		return val, true
	else
		return ct.parse_span(val, v.origin), false
	end
end
























>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
	end
	if v.raw then
		return val, true
	else
		return ct.parse_span(val, v.origin), false
	end
end

function ct.linkspans(link)
	if link.spans and next(link.spans) then return link.spans end

	local o, id, s = link.origin:ref(link.ref)
	if o then --TODO
		if type(o) == 'table' then
		end
		return {id}
	else -- it's a section link
		if s.heading_node then
			return s.heading_node.spans
		end
	end

	-- give up; the renderer decides how to represent this link
end

Modified makefile from [a11f003028] to [53dba558cc].

57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
lua-standalone = $(if $(lua-lib-prefix),$(lua-lib-prefix)/liblua.a,-llua)
lua-bindeps = -lm -ldl

ifneq ($(filter net,$(binds-names)),)
    lua-bindeps += -lcurl
endif

ifneq (luac-broken,)
    comp-lua = $(if $(debug),,env strip=1) $(lua) tool/luac.lua $1 $(if $2,>$2)
else
    comp-lua = $(luac) $(if $(debug),,-s) -o $(if $2,$2,-) $1
endif

# by default, we fetch and parse information about encodings we
# support so that cortav can do fancy things like format math







|







57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
lua-standalone = $(if $(lua-lib-prefix),$(lua-lib-prefix)/liblua.a,-llua)
lua-bindeps = -lm -ldl

ifneq ($(filter net,$(binds-names)),)
    lua-bindeps += -lcurl
endif

ifneq ($(luac-broken),)
    comp-lua = $(if $(debug),,env strip=1) $(lua) tool/luac.lua $1 $(if $2,>$2)
else
    comp-lua = $(luac) $(if $(debug),,-s) -o $(if $2,$2,-) $1
endif

# by default, we fetch and parse information about encodings we
# support so that cortav can do fancy things like format math

Modified render/html.lua from [e9754e6e72] to [2e06151bbc].

762
763
764
765
766
767
768

769
770
771
772
773
774
775
776

		function span_renderers.raw(v,b,s)
			return htmlSpan(v.spans, b, s)
		end

		function span_renderers.link(sp,b,s)
			local href = idLink(sp.ref,b)

			return tag('a',{href=href}, next(sp.spans) and htmlSpan(sp.spans,b,s) or href)
		end

		span_renderers['line-break'] = function(sp,b,s)
			return elt('br')
		end

		function span_renderers.macro(m,b,s)







>
|







762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777

		function span_renderers.raw(v,b,s)
			return htmlSpan(v.spans, b, s)
		end

		function span_renderers.link(sp,b,s)
			local href = idLink(sp.ref,b)
			local lsp = ct.linkspans(sp)
			return tag('a',{href=href}, lsp and htmlSpan(lsp,b,s) or href)
		end

		span_renderers['line-break'] = function(sp,b,s)
			return elt('br')
		end

		function span_renderers.macro(m,b,s)