{"id":778,"date":"2022-01-28T13:41:03","date_gmt":"2022-01-28T13:41:03","guid":{"rendered":"https:\/\/perfectionatic.org\/?p=778"},"modified":"2022-01-30T15:15:55","modified_gmt":"2022-01-30T15:15:55","slug":"expanding-wordpress-julias-geshi-syntax-highlighting","status":"publish","type":"post","link":"https:\/\/perfectionatic.org\/?p=778","title":{"rendered":"Expanding WordPress Julia&#8217;s  GeSHi Syntax Highlighting"},"content":{"rendered":"\n<p>In your WordPress installation  you want to modify the <code>wp-content\/plugins\/wp-geshi-highlight\/geshi\/geshi\/julia.php <\/code>file. <\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:10px\"><code>\/*\n** builtins\n*\/\n2 =&gt; array(\n    'Array', 'String', 'Bool', 'Number', 'Int', 'Integer', 'Real', 'Complex',\n    'FloatingPoint', 'Float64', 'Float32', 'Int8', 'Int16', 'Int32', 'Int64',\n    'Rational', 'AbstractArray', 'Unsigned', 'Signed', 'Uint', 'Uint8', 'Uint16',\n    'Uint32', 'Uint64', 'Vector', 'AbstractVector', 'Matrix', 'AbstractMatrix',\n    'Type', 'IO',....\n<\/code><\/pre>\n\n\n\n<p>You are trying to expand the list of those <code>builtins<\/code>. In Julia, you extract that list by running <\/p>\n\n\n\n<pre escaped=\"true\" lang=\"julia\">\njulia> [names(Core);names(Base)] .|> String |> x->filter(z->occursin(r\"^[A-Za-z]+[A-Za-z0-9]+\",z),x) |> x->join([\"'$y'\" for y in x],\", \") |> x-> replace(x,r\"(.{30,75},)\\s\"=>SubstitutionString(\" \"^12*\"\\\\1\\\\n\"))|> clipboard\n<\/pre>\n\n\n\n<p>You take the output in the clipboard and replace the contents of the aforementioned array. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>In your WordPress installation you want to modify the wp-content\/plugins\/wp-geshi-highlight\/geshi\/geshi\/julia.php file. You are trying to expand the list of those builtins. In Julia, you extract that list by running julia> [names(Core);names(Base)] .|> String |> x->filter(z->occursin(r&#8221;^[A-Za-z]+[A-Za-z0-9]+&#8221;,z),x) |> x->join([&#8220;&#8216;$y'&#8221; for y in x],&#8221;, &#8220;) |> x-> replace(x,r&#8221;(.{30,75},)\\s&#8221;=>SubstitutionString(&#8221; &#8220;^12*&#8221;\\\\1\\\\n&#8221;))|> clipboard You take the output in the clipboard and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[74],"tags":[92],"class_list":["post-778","post","type-post","status-publish","format-standard","hentry","category-julia","tag-julia"],"_links":{"self":[{"href":"https:\/\/perfectionatic.org\/index.php?rest_route=\/wp\/v2\/posts\/778","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/perfectionatic.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/perfectionatic.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/perfectionatic.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/perfectionatic.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=778"}],"version-history":[{"count":7,"href":"https:\/\/perfectionatic.org\/index.php?rest_route=\/wp\/v2\/posts\/778\/revisions"}],"predecessor-version":[{"id":824,"href":"https:\/\/perfectionatic.org\/index.php?rest_route=\/wp\/v2\/posts\/778\/revisions\/824"}],"wp:attachment":[{"href":"https:\/\/perfectionatic.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/perfectionatic.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/perfectionatic.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}