dashing icon indicating copy to clipboard operation
dashing copied to clipboard

selector: pasing qoutes in json string

Open sriramab opened this issue 5 years ago • 1 comments

Hi

I am trying to create a docset using dashing. My source html files have many class patterns. So i would like to change the "selectors" in json. But json has a string value format and the pattern that I want to match contains quotes, see code below. The entry I would like to see in dash.docset is getDescription and getExtraInfo from the html below


<tr class="memitem:aca99d01db1cef4b261dccc86da5523d7"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classGKTSDescription.html">GKTSDescription</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGKTimeSerie.html#aca99d01db1cef4b261dccc86da5523d7">getDescription</a> () const</td></tr>
--
  | <tr class="separator:aca99d01db1cef4b261dccc86da5523d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  | <tr class="memitem:a7387ac98f82fae5ed21990eabfa9a074"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classGKTimeSerie.html#a80221b55251c17773951ff42bb3835c5">ExtraInfo</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGKTimeSerie.html#a7387ac98f82fae5ed21990eabfa9a074">getExtraInfo</a> () const</td></tr>


I tried selectors with escape character \ before " , see code below

{
    "name": "Dashing",
    "package": "dashing",
    "index": "index.html",
    "selectors": {
        "h2 class=\"memtitle": "Command",
        "tr class=\"memitem": "Function"
    },
    "ignore": [
        "ABOUT"
    ],
    "icon32x32": "",
    "allowJS": false,
    "ExternalURL": ""
}

I get the following error when building docset

panic: parsing "h2 class=\"memtitle": 10 bytes left over

How do I resolve this issue?

Thank you.

sriramab avatar Sep 17 '19 14:09 sriramab

Clearly this is a super old issue, but thought I'd answer for anyone not familiar with css path selectors.

When referencing a class in a css selector, you use the dot character (i.e. period "."). So instead of "h2 class=\"momtitle", you would have "h2.memtitle"

So your code would look like:

{
    "name": "Dashing",
    "package": "dashing",
    "index": "index.html",
    "selectors": {
        "h2.memtitle": "Command",
        "tr.memitem": "Function"
    },
    "ignore": [
        "ABOUT"
    ],
    "icon32x32": "",
    "allowJS": false,
    "ExternalURL": ""
}

leothelocust avatar May 17 '22 19:05 leothelocust