Giter Club home page Giter Club logo

Comments (12)

farling42 avatar farling42 commented on July 29, 2024

from obsidian-import-json.

ckennedy666 avatar ckennedy666 commented on July 29, 2024

I'm not at my computer right now, but why do you have a tilde before the closing brackets "~}}" ? 

To suppress white space generation at those points.

from obsidian-import-json.

farling42 avatar farling42 commented on July 29, 2024

Where can I get hold of a TSV file (traveller star map) so that I can test your markdown template?

from obsidian-import-json.

farling42 avatar farling42 commented on July 29, 2024

In a quick test, you should not have the parentheses around the "Stars" name immediately after match

from obsidian-import-json.

farling42 avatar farling42 commented on July 29, 2024

The match function is better handled by a syntax like:

Stellar: 
{{#each (match Stars "[OBAFGKM]\d\s\w+|D|BD|BH|NS|PSR" "regex: true") ~}}
- {{this}}
{{/each ~}}

from obsidian-import-json.

farling42 avatar farling42 commented on July 29, 2024

Having looked at the match function, I don't think it does what we thought it does.

It will look for matches in the array of strings passed as the first parameter for any entries which match the second parameter.

What we need is a function that will break a string based on a regex.

from obsidian-import-json.

farling42 avatar farling42 commented on July 29, 2024

I've just created 0.18.0 which adds a new function 'strsplit' which splits a single string into multiple parts.

The following seems to work with the new helper function:

Stellar: {{#each (strsplit Stars (toRegex "([OBAFGKM]\d)")) ~}}
{{#ifOdd @index }}

- {{/ifOdd}}{{this}}{{/each}}

(The separator is put into the output array as a separate element, and the first element is a blank string, thus the use of #ifOdd to put the dash on a newline before the star's main classification.

from obsidian-import-json.

ckennedy666 avatar ckennedy666 commented on July 29, 2024

Hmm... Tried to update to the latest, even using BRAT, and I'm not getting the strsplit helper included. Also the version still identifies as 0.17 instead of 0.18.

from obsidian-import-json.

farling42 avatar farling42 commented on July 29, 2024

Ah, I forgot to update several files with the new version number. I'll fix it

from obsidian-import-json.

farling42 avatar farling42 commented on July 29, 2024

0.19.0 should be marked properly, and should have the strsplit helper available.

from obsidian-import-json.

ckennedy666 avatar ckennedy666 commented on July 29, 2024

I'll test tonight. Thanks for all the work.

from obsidian-import-json.

ckennedy666 avatar ckennedy666 commented on July 29, 2024

Working perfectly (once I adjusted my regex). Thanks so much!

from obsidian-import-json.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.