alvorithm
Follow
#973 2023-12-11 02:30:21 Join
964
Home View
7h28m
Online time
  • relative path for link

    2025-06-22 20:52

    Hi @88250 , probably @zacl refers to relative links to arbitrary files in the filesystem.

    The FAQ says only absolute links are supported. But it would be great if SiYuan could support relative links, e.g. to a file file:///home/user/mybooks/fiction/a.pdf as ../../mybooks/fiction/a.pdf, which would help links keep working across devices. Another option is to expand ~ to the user name and interpret links starting with ~ as relative, e.g. ~/mybooks/fiction/a.pdf. Or, perhaps best, let users customize in each SiYuan instance a root for external files, which then can be used for local attachments in place of ~. So ~ (or some other character) would default to $HOME but could be set to e.g. /home/user/syncthing/.

    This feature would go a long way towards making SiYuan the central point for all knowledge management, while keeping files that have specific locations for other reasons (e.g. sharing with 3rd parties) at their respective locations.

    On a related note: in SiYuan 3.1.32 Ctrl-Shift-V is not associated to making an hyperlink from the clipboard content (as described by the FAQ?). Ctrl-K automatically takes the text as target and anchor of a hyperlink, unlike Alt-drag-in, which finds makes the anchor be just the filename, i.e. a.pdf. The FAQ needs updating, and perhaps Ctrl-K can behave like Alt- drag-in when the clipboard contains a file:/// link?

  • Better Sync: Peer to Peer SiYuan sync plugin

    2025-06-18 17:11

    Thanks @dd3boh for this!

    It sounds as if it could be a workable approach for fast sync, in particular for paid subscribers outside of USA or China (where the datacenters are), who have to endure extra latency to those remote datacenters, and might have to pay twice if they need to relocate to new servers close to their location (see European Data Center for SiYuan Cloud Sync · Issue #15047 · siyuan-note/siyuan)

  • Blogging with SiYuan and Astro

    2025-06-10 17:27

    Thank you @massivebox for this contribution! I am wondering if the script could get the YAML metadata from a SiYuan database instead of a code block. This would allow to maintain a neat database of posts (that you can manage inside SiYuan by filtering and sorting by various criteria), and provides some input sanitization (as you enter e.g. dates through a date input widget). What do you think?

  • Choose a Primary Workspace

    2025-03-05 19:44

    Hi there,

    You can find your workspace path form a running SiYuan instance

    1. navigate to the menu (click on the button top right labeled with your workspace name, or press Alt-\ )
    2. select the workspace
    3. click on copy path, let's say the path was /home/user/SiYuan/my workspace (this is a Linux path, you may have something different on OSX or Windows)

    Armed with this, you can use the invocation siyuan --workspace="/home/user/SiYuan/my workspace".

    Graphical launcher (GNU/Linux)

    If you want to be able to launch the two different instances, on Linux you want to have two separate and differently named .desktop files. You can start by editing the one you currently have and adding the workspace path. Then you'd make a copy and change both the name and the workspace path. The .desktop files are usually located in /usr/share/applications/ or /usr/local/share/applications/ for applications installed system-wide, or ~/.local/share/applications/ for user-specific applications (refer to, e.g. Desktop entries - ArchWiki).

    Good luck!

  • Allow folders in `/assets/`

    2024-11-26 23:27

    I fully support this.

    As an addition, it would also be great to have symbolic links; then one could integrate much more with the filesystem.

  • SiYuan Template Function Guide for Newcomers: Template Syntax + Functions + Markdown Block Syntax

    2024-06-15 21:57

    This is great 👍 @frostime , I was thinking of posting the Google Translate version I had been using myself.

  • 'Add to Database' question

    2024-05-12 00:09

    Hi, @revachol, your question and @WanChen's answer helpe me come up with a solution to a slightly related problem: Advice on how to improve a database template

    Thank you!

  • SQL query with JavaScript

    2023-12-31 18:04

    I asked about it in this thread. So far I've managed to use the document id only when using the query plugin, but then I can't render the blocks like the default embed block sql queries do. I don't know how to use the id from within a normal sql query.

    Presumably, Javascript could help here, but I could not find any documentation about //!js blocks, and I can't get a minimal working example just from the GH issue (translation by Google).

  • Unreadable titles in tabs

    2023-12-22 00:08

    This can actually get very bad in other contexts, see below the bug in action in the search widget.

    @88250, @Vanessa is better to report as a bug in GitHub?

    image.png

  • Unreadable titles in tabs

    2023-12-21 02:11

    Hi, I suffer from the same problem: garbled tab labels

    image.png
    image.png

    I am on Linux - PopOS! 22.04, using SiYuan 2.11.3, my laptop has an integrated GPU.

  • Parameterized queries

    2023-12-21 00:54

    Hi,

    Tagging @zuoqiu as well (author of widget-query?).

    Reading the documentation of the widget and exploring the Refs table (use the source 😉 ), I have come up with the following SQL query

    SELECT src.* FROM blocks AS src WHERE src.id in (SELECT refs.block_id from refs WHERE refs.def_block_id='.block{.root_id}');

    This actually does what I want, i.e. it lists all the blocks pointing to the query's root block (in this case, the doc that contains the query). But

    1. widget-query renders the output as a table. I would like to render the blocks normally. Is there a way to do it like in embed block queries?
    2. alternatively, I could in principle use the same query in an embed block. But when I do, this produces no results. My question here: is the dot syntax .block{.root_id} that accesses properties of the current block not allowed in normal embeds @88250 ?

    I have searched extensively but so far I haven't found a comprehensive documentation of the query system, though I am thankful to @leolee9086 for sharing some examples in the forum.

    Please let me know if you find ways to improve my query above!

    Thank you everybody for your patience, and apologies that I just discovered the forum has a threaded reply function.

    Á.

    edit:

    1. changed = to IN in query so as to be able to list multiple incoming links.
    2. simplified the nested query, blocks as def not needed for it
  • Parameterized queries

    2023-12-20 21:14

    Hi again,

    I am wondering if using Javascript in the embed block could help here. Because I only get a partial translation and I don't know JS, I don't follow much of what is discussed in the feature request with issue number 9648, proposed by @frostime

    @frostime -- wout be possible to dynamically acquire metadata from the environment (current notebook/doc, preceding block, enclosing superblock) for use in a query by using the new //!js embed functionality?

  • Parameterized queries

    2023-12-19 21:16

    Dear @ciwoyipang, thank you so much for making me aware of the query widget. It is a very featureful extension. But I think I did not describe my need clearly. What I am after is that the query block asks its parent for the text "trip to the moon", i.e. that string in the query should be generated automatically from the context.

    select * from blocks as b where b.content like "%insert here the title or the name of the parent block%"

    So if I put this query inside a document named "The mother of all queries" it would automatically fill in the value and execute

    select * from blocks as b where b.content like "%The mother of all queries%"

    Do you have an idea on how to customize queries based on the context of the query block (e.g. the parent, or the preceding block)?

    image.png

    PS. in order to have the type column values translated, is it necessary to do it in Siyuan or in the widget code?