Skip to content

Support specifying include variables inline#681

Merged
yamgent merged 1 commit into
MarkBind:masterfrom
jamos-tay:variable-data-in-attributes
Feb 11, 2019
Merged

Support specifying include variables inline#681
yamgent merged 1 commit into
MarkBind:masterfrom
jamos-tay:variable-data-in-attributes

Conversation

@jamos-tay

Copy link
Copy Markdown
Contributor

What is the purpose of this pull request? (put "X" next to an item, remove the rest)

• [X] Enhancement to an existing feature

Fixes #642

What is the rationale for this request?

Provide a simpler syntax for specifying include variables

What changes did you make? (Give an overview)

Authors can include variables inline by adding var-... attributes:

<include src="foo.md" var-x="bat" />
==
<include src="foo.md">
  <span id="x">bat</span>
</include>

Used var instead of data as it's more variable related

@jamos-tay jamos-tay changed the title Inline include variables Support specifying include variables inline Feb 8, 2019

@yamgent yamgent left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one query, the rest looks good.

Comment thread src/lib/markbind/src/parser.js
@jamos-tay jamos-tay force-pushed the variable-data-in-attributes branch from f5e7728 to 32a7e79 Compare February 10, 2019 08:28
@jamos-tay

Copy link
Copy Markdown
Contributor Author

Rebased, see comment

@yamgent yamgent added this to the v1.17.4 milestone Feb 11, 2019
@yamgent yamgent merged commit 093bed2 into MarkBind:master Feb 11, 2019
@damithc

damithc commented Feb 11, 2019

Copy link
Copy Markdown
Contributor

@jamos-tay there was a suggestion from @acjh to use data- as the prefix (apparently, that's what HTML standard recommends). Was it changed to var- later?

@acjh

acjh commented Feb 11, 2019

Copy link
Copy Markdown
Contributor

Since the <include> tag is not in the rendered HTML, var- attributes are acceptable.

@jamos-tay

Copy link
Copy Markdown
Contributor Author

Yeah, I figured var- might be better since it's more related to variables. data might collide with some other libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Variables in includes: provide a simpler syntax

4 participants