Lots of new Telegram Features this week

Public Git Support

If you enable "Power User" mode: Power User

You will see a button on your home screen to add a public Git repository.

We make the feature a power user feature because typing in the URL of a Git repo is non-trivial and it's likely that someone who can get the URL right is, well, a power users.

YAML support for Extra Info

Seems that Extra Info is taking on a life of its own. We've extended Extra Info parsing to support YAML, so you can have particularly complex Extra Info. For example:

yaml {
   template_url: "https://github.com/telegr-am/template-blue.git",
   external_link: {
      url: "https://github.com/lift/lift-blog.git",
      has_tag_test: "x-dpp"
   external_link: {
      url: "git@github.com:telegr-am/blog-o-gram.git",
      has_tag_test: "x-dpp"
} yaml

For YAML, you must have yaml { as the first non-blank line of your file and the YAML block ends with } yaml. Tab characters are not allowed in YAML (we'll relax this restriction, but right now the YAML parser we use is obnoxious).

You can define external links to other repositories that will then be included when the current document corpus is rendered.

The external link requires a URL. It may also include a series of tests. In the above example, we link to a public Git repo (https://github.com/lift/lift-blog.git) and include all the pages with the tag x-dpp.

We also link to a private GitHub repo (git@github.com:telegr-am/blog-o-gram.git) and once again include all pages with the tag x-dpp.

For non-public repositories (external link URLs that start with git@ and dropbox:) you must white-list the linked repository by editing the site and put the URL in the "List of assets (GitHub repos and Dropbox folders) that can be linked from this Site" field (this field is only visible in Power User mode).

In these examples, we're using the external link feature to cross-post blog entries.

The really powerful way to use External Links is to host a site in Git Hub (think that you're a power user like a designer), but then share a Dropbox folder with your non-power-users. These users can update content on the site just by editing files in their Dropbox folder. But the vast majority of the site is kept in GitHub and it may or may not be shared with these users.

The restaurant example

Think about restaurants. They want to update their menus every day, but the idea of giving them credentials to a WordPress site or GitHub or something is pretty scary. So, instead, you keep the contents on their site, except for the menus, in GitHub and publish via Telegram. But you link the daily menus to a Dropbox folder. Here's the Extra Info to do that:

yaml {
external_link: {
     url: "dropbox:/telegram/your_restaurant_stuff",
     set-value-xform: ["type", "menu"]
} yaml

The above code takes all the files in the Dropbox folder /telegram/your_restaurant_stuff and marks them as menu items.

Next, on the menu page:

<div data-lift="embed.group?by=menu&descending=true&max=1&order=date&css=*+*"

Voila… We find all the files with type menu, sort by date, choose the most recent file and insert it into the <div>.

And with those few lines of code, a designer can let a restaurant manager update the menu every day (or even pre-load menus for a week) and the web site will always be up to date.