This repository has been archived on 2022-07-17. You can view files and clone it, but cannot push or open issues or pull requests.
arsenm-dev-site/public/index.min.9cdd9b109f38962a8...

7 lines
49 KiB
JavaScript
Raw Normal View History

2021-02-01 00:06:57 +00:00
var suggestions=document.getElementById('suggestions');var userinput=document.getElementById('userinput');document.addEventListener('keydown',inputFocus);function inputFocus(e){if(e.keyCode===191){e.preventDefault();userinput.focus();}
if(e.keyCode===27){userinput.blur();suggestions.classList.add('d-none');}}
document.addEventListener('click',function(event){var isClickInsideElement=suggestions.contains(event.target);if(!isClickInsideElement){suggestions.classList.add('d-none');}});document.addEventListener('keydown',suggestionFocus);function suggestionFocus(e){const focusableSuggestions=suggestions.querySelectorAll('a');const focusable=[...focusableSuggestions];const index=focusable.indexOf(document.activeElement);let nextIndex=0;if(e.keyCode===38){e.preventDefault();nextIndex=index>0?index-1:0;focusableSuggestions[nextIndex].focus();}
else if(e.keyCode===40){e.preventDefault();nextIndex=index+1<focusable.length?index+1:index;focusableSuggestions[nextIndex].focus();}}
(function(){var index=new FlexSearch({preset:'score',cache:true,doc:{id:'id',field:['title','description','content',],store:['href','title','description',],},});var docs=[{id:0,href:"/docs/advmake/",title:"AdvMake Docs",description:"Documentation for the AdvMake build system",content:""},{id:1,href:"/docs/advmake/build-files/",title:"Build Files",description:"Understanding AdvMake Build Files",content:"\u003cp\u003e\u003ca class=\"btn\" style=\"color: white; background-color: green;\" href=\"https://gitea.arsenm.dev/Arsen6331/advmake\"\u003e\n \u003cspan class=\"iconify\" data-icon=\"cib:gitea\"\u003e\u003c/span\u003e \n \u0026nbsp;AdvMake\n\u003c/a\u003e\n\n\u003ca class=\"btn\" style=\"color: white; background-color: OrangeRed;\" href=\"https://www.gitlab.com/moussaelianarsen/advmake\"\u003e\n \u003cspan class=\"iconify\" data-icon=\"fa-brands:gitlab\"\u003e\u003c/span\u003e\n \u0026nbsp;AdvMake\n\u003c/a\u003e\n\u003c/p\u003e\n\u003ch3 id=\"format\"\u003eFormat\u003c/h3\u003e\n\u003cp\u003eAdvMake uses \u003ca href=\"https://github.com/bazelbuild/starlark\"\u003eStarlark\u003c/a\u003e as the format for its build files.\nExtra builtins are also defined for both convenience and extra functionality.\u003c/p\u003e\n\u003cp\u003eStarlark is a Python-like language meant for configuration files.\u003c/p\u003e\n\u003ch3 id=\"configuration\"\u003eConfiguration\u003c/h3\u003e\n\u003cp\u003eBuild files are by default called \u003ccode\u003eAdvMakefile\u003c/code\u003e, but that can be set via \u003ccode\u003e-f\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003eAn AdvMakefile example can be found at AdvMake\u0026rsquo;s repo as it uses AdvMake itself.\u003c/p\u003e\n\u003cp\u003eAdvMake runs functions exposed by starlark in the format \u003ccode\u003e\u0026lt;name\u0026gt;_\u0026lt;target\u0026gt;\u003c/code\u003e.\nTo set the default name and target, the global variables \u003ccode\u003edefaultName\u003c/code\u003e, and \u003ccode\u003edefaultTarget\u003c/code\u003e must be set.\nHere is an example from AdvMake\u0026rsquo;s AdvMakefile:\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre class=\"chroma\"\u003e\u003ccode class=\"language-python\" data-lang=\"python\"\u003e\u003cspan class=\"n\"\u003edefaultName\u003c/span\u003e \u003cspan class=\"o\"\u003e=\u003c/span\u003e \u003cspan class=\"s2\"\u003e\u0026#34;advmake\u0026#34;\u003c/span\u003e\n\u003cspan class=\"n\"\u003edefaultTarget\u003c/span\u003e \u003cspan class=\"o\"\u003e=\u003c/span\u003e \u003cspan class=\"s2\"\u003e\u0026#34;build\u0026#34;\u003c/span\u003e\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\u003cp\u003eThis will tell AdvMake to run the function \u003ccode\u003eadvmake_build()\u003c/code\u003e when run with no arguments.\u003c/p\u003e\n\u003cp\u003eIf AdvMake is run with one argument (such as \u003ccode\u003eadvmake install\u003c/code\u003e), it will use the default name with the specified target,\nso in that case, it would run \u003ccode\u003eadvmake_install()\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eIf run with two arguments, AdvMake will use the first argument as the name and the second as the target.\nSo, running \u003ccode\u003eadvmake hello world\u003c/code\u003e would run the function \u003ccode\u003ehello_world()\u003c/code\u003e.\u003c/p\u003e\n\u003ch3 id=\"builtins\"\u003eBuiltins\u003c/h3\u003e\n\u003cp\u003eAs previously mentioned, AdvMake comes with extra builtins. Those are as follows:\u003c/p\u003e\n\u003ch4 id=\"log\"\u003e\u003ccode\u003elog()\u003c/code\u003e\u003c/h4\u003e\n\u003cp\u003eThe log function uses zerolog in go to log a message to STDOUT. It has two arguments.\nThe first is a string with the message to log, and the second is \u003ccode\u003elevel\u003c/code\u003e which is optional\u003c/p\u003e\n\u003cp\u003eExamples:\u003c/p\u003e\n\u003cdiv class=\"highlight\"\u003e\u003cpre class=\"chroma\"\u003e\u003ccode class=\"language-python\" data-lang=\"python\"\u003e\u003cspan class=\"n\"\u003elog\u003c/span\u003e\u003cspan class=\"p\"\u003e(\u003c/span\u003e\u003cspan class=\"s2\"\u003e\u0026#34;Info log\u0026#
function accept_suggestion(){while(suggestions.lastChild){suggestions.removeChild(suggestions.lastChild);}
return false;}}());