Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting inheritance #330

Open
sertonix opened this issue Jan 2, 2023 · 5 comments
Open

Setting inheritance #330

sertonix opened this issue Jan 2, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request XML
Milestone

Comments

@sertonix
Copy link
Contributor

sertonix commented Jan 2, 2023

Allow setting files to include other setting files.
This would allow to have a base config and some that have small edits for specific uses.
Also it should be possible to define partial configs.

<config parent="./base.xml">
  <term parent="./term/long-history.xml"/>
</config>
<!-- `./term/long-history.xml` -->
<term>
  <scrollback size=20000000 />
</term>
@o-sdn-o o-sdn-o self-assigned this Jan 2, 2023
@o-sdn-o o-sdn-o added enhancement New feature or request XML labels Jan 2, 2023
@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Jan 3, 2023

It also makes sense to place reusable pieces directly in the current configuration, for example, directly in <config/set>. Use a colon to point to a base block from the <config/set> namespace. If the name is in quotes, then this is a link to the file.

<config:"./base.xml">
    <menu>
        <item:dtvt_term:no_reset:rich_selection id=T1/>
        <item:dtvt_term:html_selection id=T2/>
    </menu>
    <term:"./term/long-history.xml"/>
    <set>
        <blackdk   = 0xFF101010 />
        <reddk     = 0xFF1f0fc4 />
        <greendk   = 0xFF0ea112 />
        ...
        <dtvt_term type=DirectVT cmd="$0 -r term"/>
        <no_reset>
            <config>
                <term>
                    <scrollback><reset onkey=off/></scrollback>
                </term>
            </config>
        </no_reset>
        <rich_selection>
            <config>
                <term>
                    <selection mode="rich"/>
                </term>
            </config>
        </rich_selection>
        <html_selection>
            <config>
                <term>
                    <selection mode="html"/>
                </term>
            </config>
        </html_selection>
    </set>
</config>

@o-sdn-o
Copy link
Collaborator

o-sdn-o commented Jan 3, 2023

We can also do inline nested blocks for brevity

<config:"./base.xml">
    <menu>
        <item:dtvt_term:no_reset:rich_selection id=T1/>
        <item:dtvt_term:html_selection id=T2/>
    </menu>
    <term:"./term/long-history.xml"/>
    <set>
        <blackdk   = 0xFF101010 />
        <reddk     = 0xFF1f0fc4 />
        <greendk   = 0xFF0ea112 />
        ...
        <dtvt_term type=DirectVT cmd="$0 -r term"/>
        <no_reset/config/term/scrollback/reset onkey=off/>
        <rich_selection/config/term/selection mode="rich"/>
        <html_selection/config/term/selection mode="html"/>
    </set>
</config>

@sertonix
Copy link
Contributor Author

sertonix commented Jan 3, 2023

More special syntax will make #326 harder but I really like the ideas.

@o-sdn-o o-sdn-o removed the vt-parser label Jan 3, 2023
@o-sdn-o o-sdn-o changed the title setting inhertens Setting inheritance May 23, 2023
@o-sdn-o o-sdn-o added this to the v1.0.0 milestone May 23, 2023
@o-sdn-o

This comment was marked as outdated.

@o-sdn-o

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request XML
Projects
None yet
Development

No branches or pull requests

2 participants