Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: index doesn't show the pages of the KeymanWeb guide in the correct order #1780

Open
ermshiperete opened this issue Jan 14, 2025 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@ermshiperete
Copy link
Contributor

ermshiperete commented Jan 14, 2025

It would be helpful if the index on the left would show the pages in the same order they are intended to be read, i.e. same order as on https://help.keyman.com/developer/engine/web/17.0/guide/. Currently the order is different which is not helpful since it's not clear what the next page in the guide is.

Also, the links should be consistent ("Adding keyboards" vs "Installing keyboards").

Image

@ermshiperete ermshiperete added the bug Something isn't working label Jan 14, 2025
@ermshiperete ermshiperete changed the title bug: index doesn't show the pages of the guide in the correct order bug: index doesn't show the pages of the KeymanWeb guide in the correct order Jan 14, 2025
@mcdurdin
Copy link
Member

I'm not sure how we'd do this without a lot of changes to the infrastructure of the site. The menu on the left is autogenerated from the page titles.

@mcdurdin
Copy link
Member

The only thing that would be easy would be to add a number to each page title, but that's not ideal. Note that changes to these pages should be done in the keymanapp/keyman repository now.

@ermshiperete
Copy link
Contributor Author

@mcdurdin Where is the code that does the autogeneration?

@mcdurdin
Copy link
Member

@mcdurdin Where is the code that does the autogeneration?

function build_index_content() {
global $index_content;
$this_file = basename($_SERVER['PHP_SELF']);
if($this_file == 'mdhost.php') {
$this_file = $_REQUEST['file'];
$base = dirname(realpath(__DIR__ . '/../../') . DIRECTORY_SEPARATOR . $this_file) . '/';
$path = './';
} else {
$path = './';
$base = './';
}
$items = get_file_titles($base);
$index_content = "<ul>";
foreach($items as $file => $title) {
$hetitle = htmlentities($title);
$hesttitle = htmlentities(strip_tags($title));
$cleanfile = str_replace('.md', '', str_replace('.php', '', $file));
if($file == $this_file) {
$index_content .= "<li class='current'>$hetitle</li>";
} else {
$index_content .= "<li><a href='$cleanfile' title='$hesttitle'>$hetitle</a></li>";
}
}
$index_content .= "</ul>";
$depth = 0;
while(file_exists($base . 'index.php') || file_exists($base . 'index.md')) {
if(file_exists($base . 'index.md'))
$title = get_file_title_md($base . 'index.md');
else
$title = get_file_title($base . 'index.php');
$hetitle = htmlentities($title);
$hesttitle = htmlentities(strip_tags($title));
if(($this_file == 'index.php' || $this_file == 'index.md') && $depth == 0) {
$index_content = "<ul><li><div class='current'>$hetitle</div>$index_content</li></ul>";
} else {
$index_content = "<ul><li><a href='$path'>$hetitle</a>$index_content</li></ul>";
}
$path = '../' . $path;
$base = $base . '../';
if(++$depth > 2) break;
}
}

@mcdurdin mcdurdin added this to the 19.0 milestone Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants