On 12/31/2017 11:59 AM, Lee wrote:
> On 12/31/17, Richard Owlett <[email protected]> wrote:
>> On 12/30/2017 07:47 AM, Richard Owlett wrote:
>>> On 12/29/2017 10:27 PM, null wrote:
>>>
>>>> The OP's problem is organizing the contents of his bookmarks file,
>>>> which is an sqlite file unamenable to manual editing.
>>>>
>>>
>>> I had in mind an end run around that problem.
>>> SeaMonkey has two modes of dealing with sets of bookmarks:
>>>   1. Save/Restore which uses JSON
>>>   2. Export/Import HTML
>>>      The "Export" function resembles a lossy conversion of the JSON.
>>>      It does not _appear_ to preserve nesting information. I'll have
>>>      to run more tests to confirm. My initial test flopped as I've not
>>>      read the relevant Help contents.
>>>
>>> I had in mind:
>>>   1. Save the bookmarks.
>>>   2. Pretty print the JSON to a file.
>>>   3. Edit the "pretty file" - awkward but doable.
>>>   4. "Uglify" {if required} to have syntactically correct JSON.
>>>   5. Replace the current set of bookmarks using "Restore" function.
>>>
>>
>> Other people have worked on related tools.
>> Searching planet.mozilla.org and mozillazine.org has been productive.
>> In fact the second article on planet.mozilla.org {Templating JSON/YAML
>> with json-e} suggests some aspects of json-e would be applicable to my
>> problem.
>>
>> I am also searching Debian repositories. Packages related to "aeson"
>> appear promising.
> 
> have you come across 'jq' yet?   eg: to prettyprint json:
> $ jq . bookmarks-2017-12-31.json |more
> {
>   "guid": "root________",
>   "title": "",
>   "index": 0,
>   "dateAdded": 1496405759960000,
>   "lastModified": 1514747427222000,
>   "id": 1,
>   "type": "text/x-moz-place-container",
>   "root": "placesRoot",
>   "children": [
>     {
>       "guid": "menu________",
>       "title": "Bookmarks Menu",
>   <.. snip ..>
> 
> which looks like a pain to manually edit.
> 
> What was your initial test with export as html?  I've done export as
> html, edit the file, delete all bookmarks, import the edited html &
> not noticed any problems.  What did you see?
> 
> Regards
> Lee
> 


Or python: https://docs.python.org/3/library/json.html#module-json.tool

$ cat bookmarks-2017-12-31.json | python -m json.tool > pretty.json
$ gedit pretty.json

{
                    "charset": "UTF-8",
                    "dateAdded": 1291676484000000,
                    "guid": "E2VyXb4tHph4",
                    "iconuri":
"https://www.seamonkey-project.org/images/seamonkey16.png";,
                    "id": 26,
                    "index": 3,
                    "lastModified": 1251830510000000,
                    "title": "The SeaMonkey\u00ae Project",
                    "type": "text/x-moz-place",
                    "typeCode": 1,
                    "uri": "http://www.seamonkey-project.org/";
                },



_______________________________________________
support-seamonkey mailing list
[email protected]
https://lists.mozilla.org/listinfo/support-seamonkey

Reply via email to