%<*package>

% [parameter] path of target section (verbatim) , link text
\cs_new_protected:Nn \_@@_add_section_link:nn {

    \seq_if_in:NnTF \g_@@_section_seq {./#1} {
        \group_begin:

        % @linktext
        \tl_set:Nn \l_@@_linktext_tl {#2}
        % @targetsection , @target(...)group
        \_@@_parse_path:nn {#1} {target}
        % @targetsectionpath
        \tl_set:Nn \l_@@_targetsectionpath_tl {#1}
        % @targetsectionpage
        \tl_set:Nn \l_@@_targetsectionpage_tl {\pageref*{./#1}}
        % @targetsectionname
        \prop_get:NnN \g_@@_sectionname_prop {#1} \l_@@_targetsectionname_tl
        % @targetsectionparameter
        \prop_get:NnN \g_@@_sectionparameter_prop {#1} \l_@@_targetsectionparameter_tl
        % @targetpart
        \prop_get:NnN \g_@@_sectionpart_prop {#1} \l_@@_targetpart_tl

        \hyperref [./#1] {{\g_@@_SectionLink_style_tl}}

        \group_end:
    } {
        \msg_warning:nnn {SimpleSystemTeX} {Section Not Found} {#1}
    }

}
\cs_generate_variant:Nn \_@@_add_section_link:nn {eV}

% [parameter] target block's name (expanded) , link text
\cs_new_protected:Nn \_@@_add_block_link:nn {

    \seq_if_in:NnTF \g_@@_block_register_seq {#1} {
        \group_begin:

        % @linktext
        \tl_set:Nn \l_@@_linktext_tl {#2}
        % @targetblock
        \tl_set:Nn \l_@@_targetblock_tl {#1}
        % @targetblockname
        \prop_get:NnN \g_@@_blockname_register_prop {#1} \l_@@_targetblockname_tl
        % @targetblockparameter
        \prop_get:NnN \g_@@_blockparameter_register_prop {#1} \l_@@_targetblockparameter_tl
        % @targetblockcontent
        \prop_get:NnN \g_@@_blockcontent_register_prop {#1} \l_@@_targetblockcontent_tl

        \hyperref [#1] {{\g_@@_BlockLink_style_tl}}

        \group_end:
    } {
        \msg_warning:nnn {SimpleSystemTeX} {Block Not Found} {#1}
    }

}
\cs_generate_variant:Nn \_@@_add_block_link:nn {eV}

% [parameter] scope path of index (verbatim) , link text
\cs_new_protected:Nn \_@@_add_index_link:nn {

    \seq_if_in:NnTF \g_@@_index_register_seq {./#1} {
        \group_begin:

        % @linktext
        \tl_set:Nn \l_@@_linktext_tl {#2}
        % @target(...)group
        \_@@_parse_path:nn {#1.groupkeep} {target}
        % @targetindexparameter
        \prop_get:NnN \g_@@_indexparameter_register_prop {#1} \l_@@_targetindexparameter_tl

        \hyperref [./#1] {{\g_@@_IndexLink_style_tl}}
    
        \group_end:
    } {
        \msg_warning:nnn {SimpleSystemTeX} {Block Index Not Found} {#1}
    }

}
\cs_generate_variant:Nn \_@@_add_index_link:nn {eV}

%</package>