Sections
Profile Picture of the author

"SnapApp Simplified: Transforming Content with Markdown and CLI"

on 04-06-2024 12:00 AM by Shubhayu Majumdar

460

Introducing SnapApp Docs

Markdown-First Approach for Efficient Content Management

We’re excited to announce that there’s a new Markdown-first approach for efficient content management! If you’re just getting started with SnapApp as a developer, you’ll find this approach helpful for content generation and documenting quickly.

First, let’s start by explaining the concept of a Markdown-first approach for efficient content management.

Why Opt for a Markdown-First Approach?

In SnapApp’s no-code environment, content creation is essential for developers and advocates. While Rich Text and Page Builder offer detailed design options, our Markdown-first approach via CLI streamlines content creation. This method prioritizes efficiency and consistency, empowering users to focus on impactful content generation without distractions.

All you need to do is to start writing the content, no configuration required.

Writing Content in Markdown Files

Now that you know why you would want to use Markdown, let’s take a look at how you can do it.

Start by creating a markdown file having a .md or .markdown extension with commonly used frontmatter values.

Example Frontmatter

---
title: "SnapApp Simplified: Transforming Content with Markdown and CLI"
author: Shubhayu Majumdar <shubhayu.majumdar@bluevector.ai>
date: 2024-04-06
description: SnapApp CLI simplifies content management with Markdown Integration
slug: snapapp-cli-markdown
tags: snapapp, snapapp cli, markdown
type: tips
---

If you aren’t familiar with this concept, a frontmatter is a way to store metadata in Markdown files. Typically, frontmatter metadata is stored in YAML format in a block wrapped by three dashes placed at the beginning of a Markdown file.

The following keys for metadata are supported:

  1. title: The title of the post
  2. author: The author of the post
  3. date: The date the post was created or published
  4. description: A brief description or summary of the post
  5. slug: The URL-friendly version of the post title
  6. tags: Relevant keywords or topics associated with the post
  7. type: The type or knowledge base of SnapApp. (e.g., article, tips, tutorial)
    • For the key type, make sure you have a Knowledge Base for the same in SnapApp.

After the frontmatter, the main content of the blog post is written in plain Markdown. The Markdown format makes it easy to write text that can be easily understood by both humans as well as computers.

Snapshot of current document

This is a snapshot of the current article from a markdown file.

Introducing SnapApp CLI

With the ever-growing number of features in SnapApp, you would want to be able to perform critical tasks fast and promptly across multiple instances. This is where SnapApp CLI comes in.

Let’s go ahead and install our CLI using this command:

pip3 install --upgrade --no-cache-dir https://storage.googleapis.com/snapapp/snapapp-0.1.7-py3-none-any.whl

Once snapapp cli is installed, you can go ahead and look up the current version and also verify your installation.

snapapp version

With your command line tool up and running, the next step involves intiating and logging in.

Run and Authenticate

Start the CLI using the following command and optionally with –no-interactive flag to skip the prompts and use the default values.

snapapp new

It will create a new configuration to manage and work with a SnapApp instance. But before you can do all of that, you need to log in.

snapapp login

You will receive a prompt to authenticate at a specific URL; visit the URL to authenticate your device.

Once you’ve logged in, you can test the connection:

snapapp ping

Making the Magic happen

Let’s use the CLI’s migrate-kb argument to migrate your markdown content to Knowledge Base in a snap! We will pass the filename and a version this time.

snapapp migrate-kb -f snapapp-docs.md -v v20240406

Congratulations! You’ve successfully added your first post to the SnapApp Knowledge Base 🎉

If you’re feeling adventurous and want to explore the CLI, you can find out more about how to use it right here.

Wrapping Up

As a developer, you need to be able to generate content and document quickly. Tools like this reduce the struggle make managing huge chunks seamless and allow developers to focus more on core tasks.

In this article, you have learned how SnapApp CLI can help you easily manage content through markdown and seamlessly integrate it with SnapApp. If you have more than one instance, this tool offers a convenient solution for efficiently handling content across multiple instances, ensuring consistency and ease of management.


Generate Text