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

Feature: markup positions #383

Closed
maxim-grishaev opened this issue Sep 1, 2020 · 1 comment
Closed

Feature: markup positions #383

maxim-grishaev opened this issue Sep 1, 2020 · 1 comment

Comments

@maxim-grishaev
Copy link

maxim-grishaev commented Sep 1, 2020

Currently, this wikitext:

wtf`[[abc]], abc, [[abc]]`

Produces JSON output like that:

{
  "pageID": null,
  "categories": [],
  "sections": [
    {
      "title": "",
      "depth": 0,
      "paragraphs": [
        {
          "sentences": [
            {
              "text": "abc, abc, abc",
              "links": [
                {
                  "text": "abc",
                  "type": "internal",
                  "page": "abc"
                },
                {
                  "text": "abc",
                  "type": "internal",
                  "page": "abc"
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Now it's impossible to tell where the actual links position was. It would be much more useful with something like:

[
 {
    "text": "abc",
    "type": "internal",
    "page": "abc",
	"position": [0, 3]
  },
  {
    "text": "abc",
    "type": "internal",
    "page": "abc",
	"position": [10, 13]
  }
]

WDYT?

@maxim-grishaev maxim-grishaev changed the title Feature: positions Feature: markup positions Sep 1, 2020
@spencermountain
Copy link
Owner

hey Maxim, yeah you're right. Having the offsets would be nice (but hard to do) - having an index, or a uuid could also help (easier to do).
Lemme merge this with #300 it needs some thinking.
Out of curiosity - what is your use-case? Are you adding interactions with the links or something?
cheers

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

No branches or pull requests

2 participants