changed branch to WIP Branch for demo
This commit is contained in:
@@ -39,8 +39,9 @@
|
||||
|
||||
blockquote {
|
||||
border-left: 4px solid #ddd;
|
||||
padding: 0 15px;
|
||||
padding: 1px 15px;
|
||||
color: #777;
|
||||
background: #efefef ;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -51,4 +52,3 @@
|
||||
</div>
|
||||
</body>
|
||||
</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; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user