[codelinks]# Configuration for source tracingset_local_url=false# Set to true to enable local code html and URL generationlocal_url_field="local"# Need's field name for local URLset_remote_url=true# Set to true to enable remote url to be generatedremote_url_field="remote-url"# Need's field name for remote URL[codelinks.projects.x-as-code-cpp]remote_url_pattern="https://github.com/useblocks/x-as-code/blob/{commit}/{path}#L{line}"# URL pattern for remote source code[codelinks.projects.x-as-code-cpp.source_discover]src_dir="../src"# Relative path from this TOML config to the source directoryinclude=["*.cpp","*.h"]exclude=[]gitignore=truecomment_type="cpp"[codelinks.projects.x-as-code-cpp.analyse]get_need_id_refs=trueget_oneline_needs=true[codelinks.projects.x-as-code-cpp.analyse.oneline_comment_style]start_sequence="@need:"# end_sequence for the online comments; default is an os-dependant newline characterfield_split_char=","needs_fields=[{"name"="title","type"="str"},{"name"="id","type"="str"},{"name"="type","type"="str","default"="impl"},{"name"="links","type"="list[str]","default"=[]},]
Step 3: Add the src-trace Directive
In your documentation files, add the following directive to display
traced source code links:
#include<iostream>// @need: Adding two integers, IMPL_1, impl, [REQ_0815]intadd(inta,intb){returna+b;}intmain(){std::cout<<"Hello World"<<std::endl;return0;}
Step 5: View Traced Files and Lines
After following the steps above, the documentation will show the
traced files and lines for each need in the specified project (x-as-code-cpp).
Here we show only the implementation files (not test files):