Git Product home page Git Product logo

webdocu's Introduction

Dangl.WebDocumentation - Readme

Build Status

This is a small web application that I use to host generated project documentation in Html format. It allows to control access to whom can access a project, either by making projects publicly available or by enabling access to projects for specific users.
It does accept a zip file as input and will then make the content available to be browsable through the web. You can use, for example, Sharpdox to create html documentation for C# projects, zip the output and upload it as project.

Tests and code coverage reports are generated by running TestaAndCoverage.ps1 in the root directory.

Setup

Configuration expects a connection string in the appsettings at Data:DefaultConnection:ConnectionString and two variables, AllowUserRegistration and SiteTitle. Upon deployment, the first user to register is granted the admin role. For other users, admin roles are assigned manually by an existing admin.

Configuration

Admins create and manage projects, set which users can access them and upload packages via the web interface.

Upload a package

Projects are expected in zip format. The zip archives content is copied on the server under the App_Data folder. Projects have a property defining which relative path to use initially, e.g. index.html.

Via the web interface

Admins can simply select Upload Package in the admin section for a project and upload a zip file.

Via the API

In the project edit section, the API key for a project is set, it is used for http uploads. Example with cURL:
curl -F "ApiKey=<YourApiKey>" -F "Version=<DocVersion>" -F "ProjectPackage=@\"<PathToZipPackage>\"" https://<YourDomain>/API/Projects/Upload

Access a package

Project names are required to be unique for pretty urls. Access is routed via https://<YourDomain>/Projects/<ProjectName>/<Version>/<PathToIndex>

The <Version> parameter may be set to latest to display the most recent version of the package.

Conventions When Accessing Documentation

Project file urls have the following format:

https://<YourDomain>/Projects/<ProjectName>/<Version>/<PathToFile>
  • If PathToFile is missing, a redirect is returned pointing to the entry point, e.g. https://docs.dangl-it.com/Projects/LightQuery/1.1.0 redirects to https://docs.dangl-it.com/Projects/LightQuery/1.1.0/index.html
  • If the Version is not found but a higher version is present, it redirects to the newer version. This is useful when you want to delete documentations for prerelease version. For example, 1.0.0-beta1 is requested but not present, if 1.0.0 is present, it gets redirected to it. This keeps old urls from becoming unavailable
  • If PathToFile is pointing to a non-existing file, a redirect to the entry point is returned

Response Caching

Responses for project files have two different Cache-Control headers:

  • 3600 (1 hour) if the version accessed is latest
  • 604800 (7 days) if any other version is accessed

License

View

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.