linkedin / linkedin/dustjs

Allow renaming of sections

Open
#443 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
2.9k
Forks
461
PR merge metrics
No merged PRs in 30d

Description

Working on a project that takes XML and converts it to JSON for rending by a dustjs template. In a lot of cases, some of the content has converted namespaces and the nesting level is somewhat deep. DustJS handles this pretty well, however, I find myself repeating the long section names to close them. ie:

{#lexssr_doSearchResponse.lexs_SearchResponseMessage.lexs_SearchResultPackage}
    .....content......
{/lexssr_doSearchResponse.lexs_SearchResponseMessage.lexs_SearchResultPackage}

It would be great if I could rename the content section or have the closing tag indicated differently. i.e

{#items = lexssr_doSearchResponse.lexs_SearchResponseMessage.lexs_SearchResultPackage}
      ......content......
{/items}

The "=" sign indicates that I'm aliasing the "items" identifier to the given section

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how DustJS parses and renders section tags such as {#name} and {/name}, using the example in the issue as the entry point. The work is done when a section can alias the long identifier with the proposed '=' syntax and the matching closing tag can use the alias.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.