{"id":19881557,"url":"https://github.com/chifisource/toolipsservables.jl","last_synced_at":"2026-03-04T03:02:43.844Z","repository":{"id":215372951,"uuid":"738723981","full_name":"ChifiSource/ToolipsServables.jl","owner":"ChifiSource","description":"provides components and files to toolips","archived":false,"fork":false,"pushed_at":"2025-09-03T19:59:00.000Z","size":672,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-21T15:42:48.809Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ChifiSource.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["emmaccode","UnformalPenguin"]}},"created_at":"2024-01-03T22:34:49.000Z","updated_at":"2025-09-03T19:59:04.000Z","dependencies_parsed_at":"2024-01-20T03:30:41.091Z","dependency_job_id":"088439b9-e6e8-46f5-937b-ae6649ab5fbf","html_url":"https://github.com/ChifiSource/ToolipsServables.jl","commit_stats":null,"previous_names":["chifisource/toolipsservables.jl"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ChifiSource/ToolipsServables.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChifiSource%2FToolipsServables.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChifiSource%2FToolipsServables.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChifiSource%2FToolipsServables.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChifiSource%2FToolipsServables.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChifiSource","download_url":"https://codeload.github.com/ChifiSource/ToolipsServables.jl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChifiSource%2FToolipsServables.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30070479,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T01:03:42.280Z","status":"online","status_checked_at":"2026-03-04T02:00:07.464Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T17:14:36.919Z","updated_at":"2026-03-04T03:02:43.838Z","avatar_url":"https://github.com/ChifiSource.png","language":"Julia","funding_links":["https://github.com/sponsors/emmaccode","https://github.com/sponsors/UnformalPenguin"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \n\u003cimg src=\"https://github.com/ChifiSource/image_dump/blob/main/toolips/toolipsservables.png?raw=true\" width=\"300\"\u003e\u003c/img\u003e\n\n[docs](https://chifidocs.com/toolips/ToolipsServables)\n\n[![version](https://juliahub.com/docs/General/ToolipsServables/stable/version.svg)](https://juliahub.com/ui/Packages/General/ToolipsServables)\n[![deps](https://juliahub.com/docs/General/ToolipsServables/stable/deps.svg)](https://juliahub.com/ui/Packages/General/ToolipsServables?t=2)\n[![pkgeval](https://juliahub.com/docs/General/ToolipsServables/stable/pkgeval.svg)](https://juliahub.com/ui/Packages/General/ToolipsServables)\n\n\n\u003c/div\u003e\n\n###### high-level and versatile `Component` templating\nThis package provides a versatile `Component` templating interface primarily intended to fill the role of HTML and CSS templating for [Toolips](https://github.com/ChifiSource/Toolips.jl) **0.3 +**.\n```julia\nusing Pkg; Pkg.add(\"ToolipsServables\")\n# or with the web-framework `Toolips`:\nusing Pkg; Pkg.add(\"Toolips\")\n```julia\nusing ToolipsServables\n# using Toolips.Components\n\n# creating components\nmyd::Component{:div} = div(\"example\", text = \"hello world!\")\n\nmyheading::Component{:h1} = h1(\"myheading\", text = \"example\")\n\nelements::Vector{\u003c:AbstractComponent} = [p(\"example\", text = e) for e in 1:10]\n\n# composing components\nstyle!(myheading, \"color\" =\u003e \"white\", \"font-size\" =\u003e 10pt)\npush!(myd, myheading)\nset_children!(myheading, elements)\n# writing components\nbuff = IOBuffer()\nwrite!(buff, myd)\nstr = \"\"\nwrite!(str, myd)\nusing Toolips\nc = Toolips.SpoofConnection()\nwrite!(c, myd)\n```\n### toolips servables\n`ToolipsServables` provides an extensible HTML and CSS templating platform centralized on parametric typing and extensibility. This package provides a simple API for creating beautiful websites and writing responses for files, HTML elements, CSS classes, Javascript, and CSS keyframe animations.\n###### map\n- [quick start](#toolips-servables)\n  - [documentation](#documentation)\n  - [files](#files)\n  - [components](#components)\n- [contributing](#contributing-guidelines)\n##### documentation\n- [chifidocs documentation](https://chifidocs.com/toolips/ToolipsServables)\n##### files\nAlongside an interface for templating HTML files within Julia, `ToolipsServables` also includes a parametric `File` type. Files will convert into a read `String` of themselves when `string` is used on them. \n```julia\nf = File(\"my.txt\")\n\nstring(f)\n\n    \"hello world!\"\n```\nWith `Toolips`, these types can be interpolated (*or simply served*) very easily!\n##### components\nThe most crucial goal of this package is to provide a parametric HTML templating framework for Julia. This is all facilitated through the `Component`. The `Component` is equivalent to an `HTML` element. For example we have the `HTML` `div` and the `ToolipsServables` `div`:\n```julia\nusing ToolipsServables\ncontainer = div(\"container\", contenteditable = true, text = \"hello world\")\n```\n```html\n\u003cdiv id=\"container\" contenteditable=\"true\"\u003ehello world\u003c/div\u003e\n```\nComponents are meant to be written to some output, or transformed into a `String` to be displayed as `HTML`. Using a few simple functions, we are able to compose and style these components to create our page. The main functions for these tasks are `push!`, `style!`, and occassionally `set_children!`. Yes, it really is that simple! Here is a simple page composition:\n```julia\nmainbody = body(\"bod\")\nstyle!(mainbody, \"padding\" =\u003e 25perc)\nmainheader = div(\"myheader\", align = \"center\")\nstyle!(mainpadding, \"background-color\" =\u003e \"darkgray\")\n\nmessage1 = h3(\"m\", text = \"you made it!\")\nmessage2 = h6(\"messag\", text = \"welcome to my HTML website!\")\npush!(mainheader, message1, message2)\npush!(mainbody, mainheader)\n\n\ntouch(\"example.html\"); open(\"example.html\", \"w\") do o::IO\n    write!(o, mainbody)\nend\n```\nAlong with regular HTML element components, `ToolipsServables` also includes `KeyFrames` for creating `@keyframe` CSS animations and `Style` for creating style classes with CSS. To apply a `Style` or `Animation`, we simply use `style!` `Style` will simply take style pairs similar to `style!`, whereas `KeyFrames` must be mutated with `keyframes!`.\n```julia\nexampleclass = style(\"div.myclass\", \"color\" =\u003e \"blue\", \"font-weight\" =\u003e \"bold\")\ncomp = div(\"examplediv\", text = \"sample\")\nstyle!(comp, exampleclass)\n\nfadein = keyframes(\"fadein\")\nkeyframes!(fadein, 0percent, \"opacity\" =\u003e 0percent, \"transform\" =\u003e scale(1.1))\nkeyframes!(fadein, 50percent, \"opacity\" =\u003e 100percent, \"transform\" =\u003e scale(1))\n\nstyle!(exampleclass, fadein)\n# or\n# style!(comp, fadein)\n\n# make sure to write the CSS!\nwrite!(\"\", fadein, exampleclass, comp)\n```\nHere is a **detailed** templating example which includes several forms of templating:\n```julia\nusing ToolipsServables\n# (From Toolips ?):\n#using Toolips.Components\n\n# creating components:\nmaindiv::Component{:div} = div(\"centered\", align = \"center\")\ngreeter_heading::Component{:h3} = h3(\"greeter\", text = \"hello world!\")\n# creating a style\nbgstyle::Style = style(\"greeter_style\", \"color\" =\u003e \"white\", \n\"font-weight\" =\u003e \"bold\")\n\n# styling a component directly:\nstyle!(maindiv, \"background-color\" =\u003e \"purple\", \"margin-top\" =\u003e 5px)\nleavebutton = button(\"leave\", text = \"leave\")\ngobutton = button(\"go\", text = \"go!\")\n\nstyle!(gobutton, leavebutton)\n\n# creting styles\npost_style = style(\"div.postbox\", \"border-radius\" =\u003e 5px, \"border\" =\u003e \"5px solid black\")\nfadein = keyframes(\"fadein\")\n                #  vv (or 0percent)\nkeyframes!(fadein, from, \"opacity\" =\u003e 0percent)\n                #  vv (or 100percent)\nkeyframes!(fadein, to, \"opacity\" =\u003e 100percent)\nstyle!(post_style, fadein)\n# composing a body:\nmainbod = body(\"mainbody\")\n    # animation\nstyle!(mainbod, fadein)\n    # inline styles\nstyle!(mainbod, \"padding\" =\u003e 10percent, \"background-color\" =\u003e \"lightblue\")\n    # generating post divs\nposts = [\"hello world!\", \"post example\"]\nfor (e, post) in enumerate(posts)\n    comp = div(\"post$(e)\")\n    style!(comp, post_style)\n    posthead = h4(\"head$(e)\", text = \"$(e)\")\n    postbody = p(\"body$(e)\", text = post)\n    style!(postbody, \"font-size\" =\u003e 13pt, \"color\" =\u003e \"darkgray\")\n    push!(comp, posthead, postbody)\n    # push! to body:\n    push!(mainbod, comp)\nend\n# components can be written with `write!` or turned to a `String` with `string`\n# \u003c:IO, \u003c:Toolips.AbstractConnection, `String`\n@info string(mainbod)\nresult = write!(\"\", post_style, fadein, mainbod)\n```\nFinally, `ToolipsServables` also provides parsing for these components via `htmlcomponent`.\n```julia\ncomp = \"\u003cdiv id=\\\\\"sample\\\\\"\u003ehello\u003c/div\u003e\"\n\nhtmlcomponent(comp)[\"sample\"][\"text\"]\n\n\"hello\"\n```\n#### contributing guidelines\nThere are several ways to contribute to the `ToolipsServables` package.\n\n- submitting [issues](https://github.com/ChifiSource/ToolipsServables.jl/issues)\n- creating packages which use `ToolipsServables`\n- forking and pull-requesting your changes to this code\n- trying other [chifi](https://github.com/ChifiSource) projects.\n- contributing to other [chifi](https:://github.com/ChifiSource) projects (gives more attention here).\n\nWe are not super picky on contributions, as the goal of chifi is to get more people involved in computing. However, if you want your code merged there are definitely a few things to be aware of before contributing to this package.\n\n- If there is no issue for what you want to do, create an issue.\n- If you have multiple issues, submit multiple issues rather than typing each issue into one issue.\n- Make sure the issue you are solving or feature you want to implement is still feasible on Unstable -- this is the top-level development branch which represents the latest unstable changes.\n- Please format your documentation using the technique presented in the rest of the file.\n- Make sure Pkg.test(\"ToolipsServables\") works with your version of ToolipsServables before making a pull-request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchifisource%2Ftoolipsservables.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchifisource%2Ftoolipsservables.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchifisource%2Ftoolipsservables.jl/lists"}