http://coldfusion.com logo
#lucee
Title
# lucee
a

Adam Cameron

05/09/2022, 6:54 PM
Hey I just went to add an example for https://docs.lucee.org/reference/tags/static.html#examples. I can see how to add/edit examples if there's already at least one. How do I add a first one?
s

Scott Steinbeck

05/10/2022, 5:00 AM
https://github.com/lucee/lucee-docs/tree/master/docs/03.reference/02.tags/static you would need to create an _examples.md file in the folder above and then the file contents would look something like this
Copy code
```lucee+trycf
<cfoutput>
 	<cffunction access="private" name="add">
		<cfargument name="arg1" type="Numeric" required />
		<cfargument name="arg2" type="Numeric" required />
	 	<cfreturn arg1 + arg2 />
	</cffunction>
	<cfdump var="Define function Using tag.It returns :#add(4,2)#" />
</cfoutput>
Copy code
luceescript+trycf
		writeDump("Define function using cfscript. It returns: "&add(2,3));
		public function add(required numeric arg1,required numeric arg2){
			return arg1+arg2;
		}
```
z

zackster

05/10/2022, 6:40 AM
just check out the repo and you get an interactive editor for docs!
s

Scott Steinbeck

05/10/2022, 7:08 AM
I was not aware of that
z

zackster

05/10/2022, 7:13 AM
Yeah, i spent ages a few years ago taming the whole docs project, sped up the build massively and made it easy to cross ref and edit
s

Scott Steinbeck

05/10/2022, 7:14 AM
fantastic! Thank you for working on that šŸ™‚
ā¤ļø 1
a

Adam Cameron

05/10/2022, 7:31 AM
Right... so no mechanism direct from the docs UI.
z

zackster

05/10/2022, 7:31 AM
nah, it's just a static s3 bucket and linked to github
s

Scott Steinbeck

05/10/2022, 7:32 AM
I downloaded it to play around with it but it seems to be broken
z

zackster

05/10/2022, 7:33 AM
oh yeah, what's the problem?
@Adam Cameron it's a lot easier with the local instance as via the github links it's all file by file with all the bits broken into separate files, with the local instance you can do a heap of edits and then submit a single PR with any changes
s

Scott Steinbeck

05/10/2022, 7:35 AM
the site loads up with the
serve.sh
, but it looks like none of the styles are loading, they are looking for an assets folder that is not there
z

zackster

05/10/2022, 7:36 AM
trying myself, I have it mapped under a local apache domain myself rather than with command box
s

Scott Steinbeck

05/10/2022, 7:37 AM
i also get this error on the build dash portion
and maybe its due to styles but i dont see where the editor is to edit a docs page
z

zackster

05/10/2022, 7:37 AM
ahh, that problem is due to some java issue
try with java 8, I have wanted to ditch the dash stuff anyway, I don't think anyone uses it, but hard to know
s

Scott Steinbeck

05/10/2022, 7:41 AM
if you could check on the styles i will try it out in the morning. I maybe did something wrong, I went into builders and did an npm install and ran grunt per the instructions. I can switch back to java 8 tomorrow as well
z

zackster

05/10/2022, 7:43 AM
the npm stuff is only to build static assets bundles (js & css)
i'm flat chat with other stuff at the moment, it would be great if you can dive in, as i can't repo, it's all standard lucee and commandbox
it's all routed/served via onRequest in this application.cfc https://github.com/lucee/lucee-docs/blob/master/server/Application.cfc#L81
s

Scott Steinbeck

05/10/2022, 7:57 AM
oh gotcha, ya ill check it out!
a

Adam Cameron

05/10/2022, 8:20 AM
@zackster for your use case it might be easier, where "I edit docs all the time", and poss "it's part of my 'job'" For me I saw one thing I could improve the docs with... see that there's links to edit some of the docs I'm looking at right there on the page, but no way to edit the bit I wanted to edit. Result: [shrug] and move on.
Result part 2: your docs did not get improved.
It's no big deal (for either party), but to say "this approach that is not actually suitable to your particular use case is better" is missing the mark slightly.
z

zackster

05/10/2022, 8:23 AM
you can edit a single file via the github icons on prod docs, but there's no easy way to do multiple files via that web based github edit approach.
āœ… 1
but i guess you haven't even tried out what i spent a long time contributing to make this easy
s

Scott Steinbeck

05/10/2022, 5:12 PM
@Adam Cameron if you have that example i got the local project running, so you can post it here and ill make the pull for you
a

Adam Cameron

05/10/2022, 5:13 PM
Ah I was gonna see if I could follow Zack's instructions and DIY. My patience is fairly... erm... "minimal" this evening so I might just go "rrarrr!" fairly quickly and post it back here if I get annoyed šŸ˜‰
s

Scott Steinbeck

05/10/2022, 5:18 PM
here is the interface Zak was mentioning. It is nice, once the form is posted it updates the markdown file and then you just have to push your changes
āœ… 1
a

Adam Cameron

05/10/2022, 5:18 PM
@zackster probs won't cause an issue, but there's a warning when cloning the docs on Windows:
Copy code
camer@DESKTOP-QV1A45U MINGW64 /c/src/third-party/lucee
$ git clone git@github.com:lucee/lucee-docs.git
Cloning into 'lucee-docs'...

[...]

warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:

  'docs/03.reference/01.functions/clearTimeZone/function.md'
  'docs/03.reference/01.functions/cleartimezone/function.md'

camer@DESKTOP-QV1A45U MINGW64 /c/src/third-party/lucee
There's only the one file:
lucee-docs/docs/03.reference/01.functions/clearTimeZone/function.md
, but I guess the old file is in the DB somewhere.
s

Scott Steinbeck

05/10/2022, 5:20 PM
oh and just so you get it fixed ahead of time. Iā€™m not sure why its complaining but i had to comment out these lines https://github.com/lucee/lucee-docs/blob/d38bd308bb49ccb3fcc37659b20ae8ca84ce360d/server/Application.cfc#L166-L168 to get the styles to load
āœ… 1
a

Adam Cameron

05/10/2022, 5:28 PM
I am just getting an endless sea of
275,095ms warn Missing content from Lucee: [file path]
whilst running
./build.sh
I'll let it run....
s

Scott Steinbeck

05/10/2022, 5:29 PM
yeah i got that too, didnt seem to hurt anything
a

Adam Cameron

05/10/2022, 5:29 PM
might be a worthy update to the install docs.
did it take frickin ages to run?
I'm not in a rush or anything, but still
s

Scott Steinbeck

05/10/2022, 5:30 PM
maybe a couple minutes
āœ… 1
only the first time
a

Adam Cameron

05/10/2022, 5:49 PM
853,856ms INFO Rendering Documentation (500 / 1473)
I started this before MoD started, and it's still running...
s

Scott Steinbeck

05/10/2022, 5:51 PM
weird, not sure, maybe its stuck, has it moved at all?
a

Adam Cameron

05/10/2022, 5:51 PM
Oh yeah, it's thrashing away
The timer is waaaaaay off too. That's 14min. It's been like half an hour (so actually MoD was underway before I started I guess)
but anyway... [shrug]
s

Scott Steinbeck

05/10/2022, 5:52 PM
have you installed the system update on your windows 95? maybe thats bogging you down lol jk
a

Adam Cameron

05/10/2022, 5:52 PM
oooh! Finished!
This will spin up a server using CommandBox on port 4040 and open it in your browser.
Err... no it didn't
And at this point I am too-hard-basketing this. TBH, I think the there's an audience-disconnect here. I do not want to make a lifestyle choice to become a Lucee Docs maintainer, which is what this solution seems to be aimed at. And I don't think the audience for that is very... big. I wanted to add one bit of code that I - in passing - noticed was missing. It's fine that there's an edge case that I can't do this from the docs UI. But I can't help but think that adding a stub file all the missing examples files so the already-existing UI functionality just worked mighta been a better use of time than creating a doc-editing app. Granted the latter was probably way more fun than the former. I get that.
@Scott Steinbeck just this:
Copy code
<cfcomponent>
    <!--- inside the static constructor you can define static variables, this code is executed when the "class" instance is loaded --->
    <cfstatic>
        <cfset susi=1> <!--- written to the static scope (defining the scope is not necessary) --->
        <cfset static.sorglos=2> <!--- again written to the static scope --->
    </cfstatic>
<cfcomponent>
I lifted it from the https://docs.lucee.org/guides/lucee-5/component-static.html page and converted to tags
Thanks pal
s

Scott Steinbeck

05/10/2022, 7:13 PM
https://github.com/lucee/lucee-docs/pull/1249 not sure how often PRs are reviewed, i see some in there for a few months
āœ… 1
a

Adam Cameron

05/10/2022, 8:01 PM
Thanks man. Looks like @zackster has already nailed it. Good stuff!
z

zackster

05/10/2022, 8:23 PM
it's file intensive, excluding the folders from AV makes a difference for me