adobe/aem-importer-markdown

Name: aem-importer-markdown

Owner: Adobe Systems Incorporated

Description: AEM Importer for Markdown

Created: 2017-11-06 10:39:18.0

Updated: 2018-05-18 21:16:37.0

Pushed: 2018-01-15 14:04:15.0

Homepage:

Size: 180

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

AEM Importer for Markdown

CircleCI

Imports Markdown documents into AEM, creating an AEM content package on the go.

Why would you want this?

If you have a bunch of Markdown files, for instance API documentation generated from JSON Schema, or technical documentation that you want to publish on an AEM-powered web site, for instance Adobe I/O. Your Markdown files are not hosted on Github.com, so you cannot use the built-in Markdown importer in Adobe I/O, but with this program you can include the Markdown to AEM conversion into your Continuous Integration process.

Prerequisites

This is a Java application, so you need Java 8 or higher installed on your system.

va -version
 version "1.8.0_121"
(TM) SE Runtime Environment (build 1.8.0_121-b13)
 HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

If you want to build this project from source (right now, that's required), you will also need Maven 3.

n -v
he Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
n home: /usr/local/Cellar/maven/3.3.9/libexec
 version: 1.8.0_121, vendor: Oracle Corporation
 home: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre
ult locale: en_US, platform encoding: UTF-8
ame: "mac os x", version: "10.12.6", arch: "x86_64", family: "mac"
Getting Started
Building from Source

To use the application, check out this source code, then build with Maven:

n clean package

If you are using Adobe's default settings.xml and you are outside of Adobe's VPN, it is a good idea to disable the default profile:

n clean package -P \!artifactory-corp

You will end up with a file called target/importer-with-dependencies.jar.

Creating an AEM Content Package

Run the application using java -jar and pass in a configuration file:

va -jar target/importer-jar-with-dependencies.jar markdown2AEM.yml

This will create a file importerDemo.zip, which you can install in your AEM instance using the package manager or curl command.

onfiguration

configuration happens in a `.yaml` file. This configuration file specifies where to find the Markdown files, where the content should be put in AEM and what kind of content should be created.

e are two configuration modes:
ntegrated GitHub Client: the importer will pull all files from GitHub (Enterprise)
ocal Checkout: the importer assumes you have all files in a local checkout

Integrated GitHub Client

owing settings exist for the integrated GitHub client:

ithubUrl`: hostname of your GitHub instance
ithubContentUrl`: API endpoint for retrieving binaries from GitHub
ithubApiUrl`: hostname of the GitHub API server
piToken`: the API token to access GitHub. Get it from **GitHub** -> **Settings** -> **Personal access tokens** -> **Generate new token**
ommitTime`: TODO
epositoryUrl`: URL of the repository you want to access
rivateRepository`: set `true` if this is a private repository
ranches`: a list of branches or tags that will be imported. This is useful when you have multiple API versions that need to be documented in parallel.

 Example Configuration

githubUrl: github.com githubContentUrl: https://raw.githubusercontent.com githubApiUrl: api.github.com

don't put your API token on GitHub. Use read-only tokens.

apiToken: cafea1b0c6faee11d6dcbabef838f2abcdec6feac commitTime: 1 repositoryUrl: https://github.com/iotester/importerTest privateRepository: false

branches:

Local Checkout

local checkout is ideal when you are working with a CI system that already has your Git credentials. You don't need to generate an API token, you just call `git export` or `git clone` in your build script before calling `importer.jar`.

owing settings are available for local checkout:

ithubUrl`: hostname of your GitHub instance
epositoryUrl`: URL of the repsoitory, in case you want to enable the "edit on GitHub link"
ranches`: a list of branches or tags that will be imported. This is useful when you have multiple API versions that need to be documented in parallel.
orkingDirs`: a map of branch names to local checkout directories. Both absolute and relative path names are acceptable


 Example Configuration

repositoryUrl : https://github.com/iotester/importerTest privateRepository : false

branches:

Contributing

This application is work in progress and we are happy about any contribution. You can

Releasing

This project is configured to deploy to Maven Central via Sonatype OSS. If you want to release yourself, first create an account in the Sonatype JIRA and open a new issue, requesting access to the group com.adobe.aem. Please reference trieloff and adobe-bot in your request, so that we can confirm your permission.

In the next step, edit your ~/.m2/settings.xml to include a new <server> section:

tings>
ervers>
<server>
  <id>ossrh</id>
  <username><!-- your Sonatype username --></username>
  <password><!-- your Sonatype password --></password>
</server>
servers>
ttings>
Deploying a Build

To deploy a build, use the pre-configured Maven Release Plugin with following commands:

n release:clean release:prepare
n release:perform

Releases can only be performed when you

License/Copyright

Copyright 2017 Adobe Systems Incorporated. All rights reserved. This file is licensed to you under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.