Reference

Your complete guide to Composr commands.

composr.page(id)

Defines where the project will be built where id is an the ID attribute of an HTML element.

composr.buildElement(type, content, href)

Appends a new element to the project. Note that this will not go live on the web page until composr.renderPage() is called. The parameter type (required) accepts the predefined variables header, subheader, para, and link. The parameter content accepts a string. This string can contain nested HTML if necessary. The paremeter href is only read if the type is link, and it is placed as the link location.

composr.renderPage(force)

Renders the page as HTML in the browser. The force parameter is a boolean and defines whether or not elements should be rendered if a beta version of Composr is used. Currently to render elements, force must be true.

composr.clearPage()

Removes all previously added elements from the render string. Note that this will not go live on the web page until composr.renderPage is called.

composr.clearStyles()

Removes all default Composr styling. These styles can only be recovered when the Composr library is reloaded.

Last updated

Was this helpful?