mirror of
				https://github.com/osmarks/mycorrhiza.git
				synced 2025-10-28 14:17:41 +00:00 
			
		
		
		
	Some changes
This commit is contained in:
		
							
								
								
									
										21
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								README.md
									
									
									
									
									
								
							| @@ -1,29 +1,22 @@ | ||||
| # mycorrhiza wiki | ||||
| A wiki engine inspired by fungi. Not production-ready. | ||||
|  | ||||
| This branch is devoted to version 0.8. | ||||
| * [ ] Tree generation | ||||
|   * [x] Basic generation | ||||
|   * [ ] Generation that takes non-existent hyphae into account¹ | ||||
| * [ ] History | ||||
|   * [ ] Saving all changes to git | ||||
|   * [ ] Make it possible to see any previous version | ||||
|   * [ ] A nice UI for that | ||||
|  | ||||
| ¹ Current algorithm won't detect `a/b/c` as a child of `a` if `a/b` does not exist. | ||||
| # MycorrhizaWiki | ||||
| A wiki engine inspired by fungi. | ||||
|  | ||||
| ## Current features | ||||
| * Edit pages through html forms | ||||
| * Responsive design | ||||
| * Works in text browsers | ||||
| * Pages (called hyphae) can be in gemtext. | ||||
| * Pages (called hyphae) are in gemtext | ||||
| * Everything is stored as simple files, no database required | ||||
| * Page trees | ||||
| * Changes are saved to git | ||||
| * History page | ||||
|  | ||||
| ## Future features | ||||
| * Tags | ||||
| * Authorization | ||||
| * History view | ||||
| * Granular user rights | ||||
| * A better page tree algorithm | ||||
|  | ||||
| ## Installation | ||||
| I guess you can just clone this repo and run `make` to play around with the default wiki. | ||||
|   | ||||
| @@ -6,16 +6,13 @@ import ( | ||||
| 	"strings" | ||||
| ) | ||||
|  | ||||
| func Revisions(filepath string) ([]Revision, error) { | ||||
| 	if filepath == "" { | ||||
| 		return []Revision{}, nil | ||||
| 	} | ||||
| func Revisions(hyphaName string) ([]Revision, error) { | ||||
| 	var ( | ||||
| 		out, err = gitsh( | ||||
| 			"log", "--oneline", "--no-merges", | ||||
| 			// Hash, Commiter email, Commiter time, Commit msg separated by tab | ||||
| 			"--pretty=format:\"%h\t%ce\t%ct\t%s\"", | ||||
| 			"--", filepath, | ||||
| 			"--", hyphaName+"&.*", | ||||
| 		) | ||||
| 		revs []Revision | ||||
| 	) | ||||
|   | ||||
| @@ -41,11 +41,12 @@ func handlerRevision(w http.ResponseWriter, rq *http.Request) { | ||||
| 		<main> | ||||
| 			<nav> | ||||
| 				<ul> | ||||
| 					<li><a href="/page/%[1]s">See the last revision</a></li> | ||||
| 					<li><a href="/page/%[1]s">See the latest revision</a></li> | ||||
| 					<li><a href="/history/%[1]s">History</a></li> | ||||
| 				</ul> | ||||
| 			</nav> | ||||
| 			<article> | ||||
| 				<p>Please note that viewing binary parts of hyphae is not supported in history for now.</p> | ||||
| 				%[2]s | ||||
| 				%[3]s | ||||
| 			</article> | ||||
| @@ -68,20 +69,14 @@ func handlerHistory(w http.ResponseWriter, rq *http.Request) { | ||||
| 	log.Println(rq.URL) | ||||
| 	hyphaName := HyphaNameFromRq(rq, "history") | ||||
| 	var tbody string | ||||
| 	if data, ok := HyphaStorage[hyphaName]; ok { | ||||
| 		revsT, err := history.Revisions(data.textPath) | ||||
| 	if _, ok := HyphaStorage[hyphaName]; ok { | ||||
| 		revs, err := history.Revisions(hyphaName) | ||||
| 		if err == nil { | ||||
| 			for _, rev := range revsT { | ||||
| 			for _, rev := range revs { | ||||
| 				tbody += rev.AsHtmlTableRow(hyphaName) | ||||
| 			} | ||||
| 		} | ||||
| 		revsB, err := history.Revisions(data.binaryPath) | ||||
| 		if err == nil { | ||||
| 			for _, rev := range revsB { | ||||
| 				tbody += rev.AsHtmlTableRow(hyphaName) | ||||
| 			} | ||||
| 		} | ||||
| 		log.Println(revsT, revsB) | ||||
| 		log.Println(revs) | ||||
| 	} | ||||
|  | ||||
| 	table := fmt.Sprintf(` | ||||
|   | ||||
 Submodule metarrhiza updated: e0e48d39b8...41b2e0bda1
									
								
							
		Reference in New Issue
	
	Block a user
	 Timur Ismagilov
					Timur Ismagilov