changed branch to WIP Branch for demo

This commit is contained in:
Per Ploug
2017-06-05 16:56:03 +02:00
parent efc11c1f40
commit 85b7243186
3 changed files with 31 additions and 17 deletions
+12 -12
View File
@@ -3,10 +3,10 @@
@{
Layout = null;
var path = HttpContext.Current.Items[MarkdownLogic.MarkdownPathKey].ToString();
var path = HttpContext.Current.Items[MarkdownLogic.MarkdownPathKey].ToString();
var ml = new MarkdownLogic(path) { PrefixLinks = false, AppendAltLessonLink = true };
var markdown = ml.DoTransformation();
var markdown = ml.DoTransformation();
}
<html>
@@ -14,33 +14,34 @@
<title></title>
<link href="https://fonts.googleapis.com/css?family=Asap:400,700,400italic,700italic" type="text/css" rel="stylesheet"/>
<style>
<style>
body {
font-family: Asap, sans-serif;
}
code {
background-color: #eeeeee;
code {
background-color: #eeeeee ;
padding: 5px;
}
pre {
pre {
word-wrap: break-word;
white-space: pre-wrap;
}
pre > code {
pre > code {
display: block;
}
img {
img {
max-width: 90%;
}
blockquote {
blockquote {
border-left: 4px solid #ddd;
padding: 0 15px;
padding: 1px 15px;
color: #777;
background: #efefef ;
margin: 0;
}
</style>
@@ -50,5 +51,4 @@
@Html.Raw(markdown)
</div>
</body>
</html>
</html>
@@ -125,7 +125,7 @@ namespace OurUmbraco.Documentation.Busineslogic.GithubSourcePull
RemoveExistingDocumentation(RootFolder);
ZipFile.ExtractToDirectory(zip, RootFolder);
var unzippedPath = RootFolder + "\\UmbracoDocs-master\\";
var unzippedPath = RootFolder + "\\UmbracoDocs-StarterkitLessons\\";
foreach (var directory in new DirectoryInfo(unzippedPath).GetDirectories())
Directory.Move(directory.FullName, RootFolder + "\\" + directory.Name);
foreach (var file in new DirectoryInfo(unzippedPath).GetFiles())
@@ -156,7 +156,10 @@ namespace OurUmbraco.Documentation.Busineslogic.GithubSourcePull
public int sort { get; set; }
public bool hasChildren { get; set; }
public List<SiteMapItem> directories { get; set; }
public string url => $"https://our.umbraco.org/documentation{this.path}/?altTemplate=Lesson";
public string url => $"http://localhost:24292/documentation{this.path}/?altTemplate=Lesson";
//public string url => $"https://our.umbraco.org/documentation{this.path}/?altTemplate=Lesson";
}
private SiteMapItem GetFolderStructure(DirectoryInfo dir, string rootPath, int level)
@@ -10,6 +10,7 @@ using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi;
using System.Web;
using OurUmbraco.Documentation.Busineslogic;
using System.Runtime.Serialization;
namespace OurUmbraco.Documentation.Controllers
{
@@ -63,13 +64,13 @@ namespace OurUmbraco.Documentation.Controllers
return currentDirectory.directories.OrderBy(x=> x.sort).ToList();
}
public List<string> GetStepsForPath(string path)
public List<LessonStep> GetStepsForPath(string path)
{
var docs = new ZipDownloader();
var rootFolder = global::Umbraco.Core.IO.IOHelper.MapPath("/Documentation/" + path);
var mdFiles = System.IO.Directory.GetFiles(rootFolder, "*.md");
var result = new List<string>();
var result = new List<LessonStep>();
foreach(var fpath in mdFiles)
{
var content = System.IO.File.ReadAllText(fpath);
@@ -77,11 +78,21 @@ namespace OurUmbraco.Documentation.Controllers
var md = new MarkdownLogic(fpath);
var html = md.DoTransformation();
result.Add(html);
result.Add(new LessonStep() { Name = name, Content = html });
}
return result;
}
}
[DataContract(Name = "lessonStep")]
public class LessonStep
{
[DataMember(Name = "name")]
public string Name { get; set; }
[DataMember(Name = "content")]
public string Content { get; set; }
}
}