Browse Source

feature: include from *pointer

some-fixes
Volker Birk 6 months ago
parent
commit
841338d49a
4 changed files with 13 additions and 6 deletions
  1. +8
    -1
      features.en.yhtml2
  2. +1
    -1
      heading.en.yhtml2
  3. +2
    -2
      yml2/backend.py
  4. +2
    -2
      yml2/grammar.py

+ 8
- 1
features.en.yhtml2 View File

@ -992,7 +992,7 @@ page "The Features" {
Code | include reverse part*.yml2
p > If there are the files part1.yml, part2.yml and part3.yml, part3.yml is included first now.
p > If there are the files part1.yml2, part2.yml2 and part3.yml2, part3.yml2 is included first now.
p > To include plain text as text nodes, you can use:
@ -1002,6 +1002,13 @@ page "The Features" {
Code | include xml some.xml
p > If there is a file mask or a filename in a pointer you can include indirectly:
Code ||
declare files = "*.yml2"
include from *files
||
h2 id=python > Escaping into Python – the Escape Operator !
p > You can insert a Python command at any place by using the «!» operator:


+ 1
- 1
heading.en.yhtml2 View File

@ -13,7 +13,7 @@ decl ne is a {
div id=headline {
p > YML – Why a Markup Language?!
div class=small {
"YML 2.6.3 of Thu 19 Mar 2020 – Copyleft 2007-2020, "
"YML 2.7.0 of Thu 08 Apr 2021 – Copyleft 2007-2021, "
a "http://blog.fdik.org", "Volker Birk";
" – "
a "http://fdik.org/yml2.tar.bz2", "Download YML 2";


+ 2
- 2
yml2/backend.py View File

@ -1,4 +1,4 @@
# 2.6.1 backend
# 2.7.0 backend
# written by VB.
@ -734,7 +734,7 @@ def codegen(obj):
filemask = arg
if kpointer:
filemask = pointer(filemask)
filemask = eval(pointer(filemask))
if filemask[0] == '/' or filemask[0] == '.':
files = sorted(glob(filemask))


+ 2
- 2
yml2/grammar.py View File

@ -79,7 +79,7 @@ def in_ns(): return keyword("in"), xmlSymbol, [_decl, ("{", -2, _decl, "}
_decl = keyword("decl"), listing(decl), [";", "."]
def textsection(): return r(r'(\|\|(\>*)(.*?)\|\|(\>*))\s*$', re.S | re.M)
def textsectionu(): return r(r'(\>\>.*?\>\>)', re.S)
def include(): return keyword("include"), 0, reverse, 0, [ktext, kxml], [(kpointer, pointer), filename], 0, [";", "."]
def include(): return keyword("include"), 0, reverse, 0, [ktext, kxml], 0, kpointer, filename, 0, [";", "."]
def func(): return _func, 0, content
def funclist(): return listing(func)
_cmd = funclist, 0, [";", "."]
@ -106,5 +106,5 @@ def content(): return [ (_l, 0, _p, 0, _b, 0, _c), (_p, 0, _b, 0, _c), (_b,
def reverse(): return keyword("reverse")
def ktext(): return keyword("text")
def kxml(): return keyword("xml")
def kpointer(): return keyword("pointer")
def kpointer(): return keyword("from")
def ymlCStyle(): return -1, [_decl, in_ns, include, python, operator, constant, tagQuote, lineQuote, quote, _cmd]

Loading…
Cancel
Save