Open DanRathbun opened 6 years ago
I agree the mentions of .ini files should be removed but I'm not sure if the new JSON approach should be mentioned here as it lies outside of the API contract. The implementation could be interesting to know, maybe mostly for system administrators syncing up machines, but I think it's outside the scope of the API. Maybe this can be documented elsewhere, or the phrasing could clarify this is an implementation detail.
Don't get me wrong, I've relied on knowledge about the JSON files myself to manually sync them when the IT department failed, but SketchUp should also be able to change the implementation at any point without breaking API.
... as it lies outside of the API contract.
But it is within the "Application Contract" ? ... until the application release notes state otherwise ?
Maybe this can be documented elsewhere, ...
It is (as said,) in the application release notes. I'm not sure why, as it is really extension developers that care, or needed to read and write to these files.
I did suggest two courses of action, the latter ...
A. Provide a separate write up in the "Files" collection explaining this detailed history and implementation of extension defaults and preferences, giving paths, sample code, etc, etc.
B. Simplify the docstrings for #read_default and #write_default to simply use a generic term like "preference settings" rather than ".ini" or "registry" or "plist" "json file" etc.
C. Add a "For more detail, history and coding tips, see Saving Preferences" link to the separate markdown file in the "Files" collection, for both methods.
Anyway ... I think I did open an issue that C API release notes are listed in the application release notes, rather than in the C SDK, and coders wonder where the notes are. They don't think to go looking at the end user application release notes.
So ... I stress again, put the information for coders where they'll go looking for it.
SketchUp should also be able to change the implementation at any point without breaking API.
I agree, and they have. Even though some coders used registry read code to read setting directly from the registry, it didn't stop the SU Dev team from implementing a better solution. The rollout might have broken some code "in the wild", but that was just too bad for the coder. They had to adapt their code.
I think we could have a separate page with historic details that the docs can link to and expand in more detail. In most cases the details of how settings are stored is irrelevant. For the edge cases we can have a separate information to aid developers.
I think it may be time to create a new repo for the extra Files section.
In addition to categorical pages, each class should get it's own "lost manual" kind of page, with tip, tricks, pitfalls and extended code examples.
Re:
Sketchup::read_default
Sketchup::write_default
Whereas the Application Release notes for v18 explains the new locations for user preferences ...
In the ruby.sketchup.com docs (api-stubs) ...
EITHER:
A. Sectionalize the docstring for v18+ and v17 and earlier
B. In the v18+ section:
Give JSON filepaths
Explain the difference between "private" and "shared"
C. In the v17 and older section:
.ini
files (as this is no longer true and if it ever was, was likely pre v6 and no one remembers or cares.)OR:
A. Provide a separate write up in the "Files" collection explaining this detailed history and implementation of extension defaults and preferences, giving paths, sample code, etc, etc.
B. Simplify the docstrings for
#read_default
and#write_default
to simply use a generic term like "preference settings" rather than ".ini
" or "registry" or "plist" "json file" etc.C. Add a "For more detail, history and coding tips, see Saving Preferences" link to the separate markdown file in the "Files" collection, for both methods.
Example Code