Skip to content

normesta/vs-cordova-docs-sample

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DPS Web Experience Sample Website

Sample web site that renders articles published by Azure DPS (Documentation Publishing System). This sample should be used by teams onboarding to DPS as a reference for implementing their rendering experience.

Documentation Controller class

The DocumentationController class provides the necessary methods to list and give the details of the documentation articles.

Public methods

Index

Lists the documentation articles for the specified culture.

Parameters
  • culture
    • Type: System.String
    • Culture from where the articles list will be loaded.

Remarks

The documentation articles will be loaded from the storage container specified in the container app settings. In case the container does not contain articles for the specified culture, the controller will try to load the content from the default culture (en-us) folder.

Article

Loads a documentation article culture.

Parameters
  • culture
    • Type: System.String
    • Culture from where the articles list will be loaded.
  • id
    • Type: System.String
    • The identifier of the documentation article.

Remarks

The article will be loaded from the storage container specified in the container app settings. In case the container does not contain the requested article for the specified culture, the controller will try to load the content from the default culture (en-us) folder.

Private methods

GetPublishedVersion

Loads the version info from the settings file in the storage container.

Parameters
  • blobContainer
    • Type: Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer
    • The blob storage container.
  • culture
    • Type: System.String
    • Culture identifier.

Remarks

The PublishVersionInfo will be deserialized from the settings.json file located in the culture folder of the given storage container.

GetContent

Loads the blob text content.

Parameters
  • blob
    • Type: Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob
    • Documentation article blob.

Remarks

This method returns an HTML-encoded string with the blob content.

GetArticleMetada

Parse the documentation article metadata from the given blob.

Parameters
  • blockBlob
    • Type: Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob
    • Documentation article blob.

Remarks

This method extracts the metadata attributes of the given blob and returns a new documentation Article object with this parsed data.

GetContributorsAndAuthors

Get a list containing the authors of the article and the contributors.

Parameters
  • article
    • Type: ACOM.DocumentationSample.Models.Article
    • A documentation article object.

Remarks

Get a unified list of GithubAuthor containing the article Authors and Contributors.

ParseTags

Parse the article tags.

Parameters
  • tagsString
    • Type: System.String
    • A JSON array containing the article tags.

Remarks

Returns the deserialized dictionary with the documentation article tags.

GetSlugFromBlobName

Resolve the slug from a blob name.

Parameters
  • blobName
    • Type: System.String
    • Blob name.

Remarks

Returns the slugified blob name.

ParseTags

Parse the article tags

Parameters
  • tagsString
    • Type: System.String
    • A JSON array containing the article tags.

Remarks

Returns the deserialized dictionary with the documentation article tags.

ParseAuthors

Parse the authors names from a comma separated string.

Parameters
  • articleAuthorString
    • Type: System.String
    • Comma separated array of author names.

Remarks

Returns an array of strings containing the parsed authors.

ParseGitHubContributors

Deserialize the GithubContributors list.

Parameters
  • githubContributorsString
    • Type: System.String
    • JSON string containing the array of Github Authors.

Remarks

Returns a collection with the parsed GithubAuthors.

Documentation Article metadata

All documentation articles contain the following metadata properties to enable some website automation and SEO stuff.

Property Description Example
x-ms-meta-pageTitle Page title Page title
x-ms-meta-articleTitle Article title Article title
x-ms-meta-metaDescription Article meta description This is an article
x-ms-meta-articleAuthor CSV list of authors author1, author2
x-ms-meta-githubContributors Contributors JSON array [{"Id":"123456", "Login":"jdoe", "Name":"John Doe"},{"Id":"654321", "Login":"user1", "Name":"Another User"}]
x-ms-meta-createdDate Article Creation Date 06-15-2009 01:45:30 PM

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 65.9%
  • CSS 20.2%
  • JavaScript 13.8%
  • Classic ASP 0.1%