Skip to main content
Deno 2 is finally here 🎉️
Learn more

js -> markdown (documentation)

this is handy if you want to have the description of the usage of your code directyly in your testing source code javascript

//readme_custom.md:start
//md: # f_add 
//md: this is a function that adds two numbers
let n1 = 1;
let n2 = 2;
let f_add=(n1,n2)=>{return n1+n2}
//readme_custom.md:end
//this will not be present in the markdown since we closed the file with [filename.md]:end
//readme_custom.md:start
//md: # f_sub
//md: this is 
//md: `f_sub`, can be used to subtract numbers
let f_sub(n1,n2)=>{return n1-n2}

//md: ## usage
let b = 3 == f_add(1,2);
let b = 2 == f_sub(8,6);
//readme_custom.md:end

the file readme_custom.md was generated by inputing the content from this file into it