shaarli / Shaarli

The personal, minimalist, super-fast, database free, bookmarking service - community repo
https://shaarli.readthedocs.io/
Other
3.4k stars 287 forks source link

How might I export bookmarks with their associated tags please? #2091

Open SkyNetGlobal opened 3 months ago

SkyNetGlobal commented 3 months ago

I have what I believe to be a fairly basic installation in a Docker Compose file with about 3,900 links (all private) and 2,601 tags.

Here is a copy of the config.json.php file - some 77 lines long - and I would be grateful if someone here could help me add code so I might export the URLs with their associated tags.

<?php /*{
    "resource": {
        "data_dir": "data",
        "config": "data\/config.php",
        "datastore": "data\/datastore.php",
        "ban_file": "data\/ipbans.php",
        "updates": "data\/updates.txt",
        "log": "data\/log.txt",
        "update_check": "data\/lastupdatecheck.txt",
        "history": "data\/history.php",
        "raintpl_tpl": "tpl\/",
        "theme": "default",
        "raintpl_tmp": "tmp\/",
        "thumbnails_cache": "cache",
        "page_cache": "pagecache"
    },
    "security": {
        "ban_after": 4,
        "ban_duration": 1800,
        "session_protection_disabled": false,
        "open_shaarli": false,
        "allowed_protocols": [
            "ftp",
            "ftps",
            "magnet"
        ]
    },
    "general": {
        "header_link": "\/",
        "links_per_page": 20,
        "enabled_plugins": [
            "qrcode"
        ],
        "default_note_title": "Note: ",
        "retrieve_description": true,
        "enable_async_metadata": true,
        "tags_separator": " ",
        "timezone": "Country goes here\/City goes here",
        "title": "Shaarli"
    },
    "updates": {
        "check_updates": true,
        "check_updates_interval": 86400
    },
    "feed": {
        "rss_permalinks": true,
        "show_atom": true
    },
    "privacy": {
        "default_private_links": false,
        "hide_public_links": false,
        "force_login": false,
        "hide_timestamps": false,
        "remember_user_default": true
    },
    "thumbnails": {
        "mode": "all",
        "width": "125",
        "height": "90"
    },
    "translation": {
        "language": "auto",
        "mode": "php",
        "extensions": []
    },
    "plugins": [],
    "formatter": "markdown",
    "credentials": {
        "login": "Shaarli",
        "salt": "salt goes here",
        "hash": "hash goes here"
    },
    "api": {
        "enabled": true,
        "secret": "secret api goes here"
    }
}*/ ?>
nodiscc commented 3 months ago

Hi @SkyNetGlobal

export the URLs with their associated tags

The HTML export will export all your links with their associated tags.

There is nothing to configure.

Is there something wrong with the HTML export?

SkyNetGlobal commented 3 months ago

I had thought I might see a URLwith the tag appended to the URL something like this: http://scenic.com.au [tag=travel]

Shaarli

I cannot see all the tags listed in the exported .html file

nodiscc commented 3 months ago

I see; the export uses the "Netscape HTML bookmarks" format, tags are not visible from a web browser. They are embedded in special HTML tags inside the file so they are properly restored when importing back to Shaarli (or as bookmark folders when importing to a browser)

There is no built-in way right now to export the full listing with description, tags, metadata, etc... in a way that is visible in a browser (except maybe, set the links per page to 999999 and use the browser Save as... function to save a full copy)

This was discussed in https://github.com/shaarli/Shaarli/issues/1328 and I ended up writing a tool to export everything to a single file which shows tags and allows basic filtering https://github.com/nodiscc/hecat (look into the shaarli section)

image

SkyNetGlobal commented 2 months ago

nodiscc,

Thank you for writing this tool 👍. I tried changing the number of links to 999999 and “save As” but that bit not work for me.

My coding and technical abilities are not good enough to understand how to actually install and run your code so I’ll reach out for help from a programmer in the future.

Thank you for you time :)

nodiscc commented 2 months ago

Ok. For what it's worth, I found that using the Print to PDF feature of Firefox preserves links in the output PDF file, you way want to use that, as a workaround.